Compare commits

..

1 Commits

Author SHA1 Message Date
Mario Fetka 9d0ee5010b Import release 2.0rc1 2009-07-17 15:44:01 +00:00
187 changed files with 41747 additions and 39906 deletions
+43
View File
@@ -0,0 +1,43 @@
[Buildset]
Number of Builditems=1
[Buildset][Builditem0]
Itemname=KMess
Itempath=./
Projectname=KMess
[CMake]
BuildDirs=./build
CMakeDir=/usr/share/cmake/Modules
Current CMake binary=cmake
CurrentBuildDir=./build
CurrentInstallDir=
ProjectRootRelative=./
[Chat Window debug-Run Options]
Arguments=--runtest chatwindow
Executable=./build/src/kmess
Working Directory=./build/src/
[Contact List debug-Run Options]
Arguments=--runtest contactlist
Executable=./build/src/kmess
Working Directory=./build/src/
[Debug-Run Options]
Executable=./build/src/kmess
[MakeBuilder]
Abort on First Error=false
Number Of Jobs=3
Run Multiple Jobs=true
[Project]
VersionControlSupport=kdevsubversion
[Run Options]
Run Targets=Chat Window debug,Contact List debug,Debug
[Veritas]
executables=
framework=QTest
+7 -1
View File
@@ -101,6 +101,10 @@
Vincenzo Reale <smart2128@baslug.org>
Andrea Decorte <adecorte@gmail.com>
Japanese:
Daniel E. Moctezuma <shinsen27@gmail.com>
Korean:
Park Dong Cheon <pdc@kaist.ac.kr>
@@ -119,7 +123,7 @@
Slovenian:
Matjaž kaše <kase@g-kabel.si>
Matjaž Kaše <kase@g-kabel.si>
Spanish:
@@ -131,6 +135,7 @@
Juan Pablo González Tognarelli <jotapesan@gmail.com>
Alexis Daniel Medina Medina <alexismedina@gmail.com>
Manuel Ramírez <elpreto@kde.org.ar>
Mauricio Muñoz Lucero <real.mml@gmail.com>
Swedish:
@@ -221,6 +226,7 @@
Amarok
- Custom crash handler implementation
- System tray icon overlay implementation
Quassel
- KNotify not giving focus bug fix and KWin focus stealing prevention workaround
+8 -16
View File
@@ -127,8 +127,8 @@ INCLUDE_DIRECTORIES( ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${LIBXM
#### Define the app version number ####
# Switch between the following two commands to force using a predefined version number
#EXECUTE_PROCESS( COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/cmake/get-svn-version.sh OUTPUT_VARIABLE KMESS_VERSION )
SET( KMESS_VERSION "2.0beta2" )
# EXECUTE_PROCESS( COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/cmake/get-svn-version.sh OUTPUT_VARIABLE KMESS_VERSION )
SET( KMESS_VERSION "2.0rc1" )
#### Define compiler flags ####
@@ -169,13 +169,6 @@ ENDIF( CMAKE_BUILD_TYPE STREQUAL debugfull OR KMESS_DEBUG_OUTPUT EQUAL 1 )
# Change symbol visibility, to obtain clearer KDE backtraces
SET( __KDE_HAVE_GCC_VISIBILITY 0 )
# Set a default value for relocatable binary support
IF( KMESS_ENABLE_BINRELOC EQUAL 1 )
SET( KMESS_ENABLE_BINRELOC "1" )
ELSE( KMESS_ENABLE_BINRELOC EQUAL 1 )
SET( KMESS_ENABLE_BINRELOC "0" )
ENDIF( KMESS_ENABLE_BINRELOC EQUAL 1 )
# Disable LikeBack if not needed
IF( KMESS_DISABLE_LIKEBACK EQUAL 1 )
SET( KMESS_DISABLE_LIKEBACK "1" )
@@ -184,12 +177,6 @@ ELSE( KMESS_DISABLE_LIKEBACK EQUAL 1 )
ENDIF( KMESS_DISABLE_LIKEBACK EQUAL 1 )
# Enable the experimental webcam connection if needed
IF( NOT DEFINED KMESS_ENABLE_WEBCAM )
SET( KMESS_ENABLE_WEBCAM "0" )
ENDIF( NOT DEFINED KMESS_ENABLE_WEBCAM )
# Set a default installation path
IF( NOT CMAKE_INSTALL_PREFIX )
SET( CMAKE_INSTALL_PREFIX "/usr" )
@@ -239,10 +226,15 @@ CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/config-kmess.h.in ${CMAKE_CURR
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )
# continue in directories
ADD_SUBDIRECTORY( src )
ADD_SUBDIRECTORY( po )
ADD_SUBDIRECTORY( data )
ADD_SUBDIRECTORY( doc )
ADD_SUBDIRECTORY( src )
IF( LIBKONQ_FOUND )
ADD_SUBDIRECTORY( src/utils/kmess-send )
ENDIF( LIBKONQ_FOUND )
# Also add the tests if compiling in development mode
IF( CMAKE_BUILD_TYPE STREQUAL debugfull AND KMESS_DEBUG_OUTPUT EQUAL 1 )
+356
View File
@@ -1,4 +1,358 @@
--- 2.0rc1 released ---
2009-07-17 (Valerio)
* Fixed contact list tooltips with Right-to-Left text layouts.
2009-07-16 (Pano)
* Merged an updated Brazilian Portuguese translation by Maurício Arozi Moraes.
* Merged an updated Japanese translation by Daniel E. Moctezuma.
* Merged an updated Arabic translation by Ma'moun Diraneyya.
* Merged an updated German translation.
2009-07-15 (Pano)
* Merged an updated Greek translation by Dimitrios Glentadakis.
* Merged an updated Finnish translation by Antoni Hussy.
* Merged an updated German translation.
2009-07-14 (Valerio)
* Removed BinReloc, AutoPackage, and the other packaging support files.
* Removed code which will never be in any 2.0.x release: WebApplication, NetMeeting/GnomeMeeting,
audio conversation, SIP, UPNP, Webcam, Roaming, RemoteDesktop.
2009-07-14 (Pano)
* Merged an updated Japanese translation by Daniel E. Moctezuma.
* Merged an updated Hungarian translation by Pauli Henrik.
2009-07-14 (dazjorz)
* Removed unused member currentStatus_ from KMess object.
* Fixed reconnection resetting the status to the default initial status,
instead of the last status before the connection was lost.
* Set our new shiny KDE debug number to be the default.
2009-07-13 (Pano)
* Merged an updated Japanese translation by Daniel E. Moctezuma.
* Merged an updated German translation.
* Merged an updated Catalan translation by Adrià Arrufat.
2009-07-11 (Pano)
* Merged an updated German translation.
2009-07-10 (Valerio)
* Added a little more space between the contact properties and their name in the Contact List tooltips.
2009-07-09 (Valerio)
* Improved the looks of elided labels and increased the size of the user's friendly name.
2009-07-09 (Pano)
* Merged an updated Slovak translation by Rastislav Krupanský.
* Merged an updated German translation.
2009-07-09 (Adam)
* Backport from trunk: fix bug where account would be saved when "Remember Account" was
unchecked.
2009-07-08 (Pano)
* Added an Japanese translation by Daniel E. Moctezuma.
* Merged an updated Brazilian Portuguese translation by Sergio Rafael Lemke.
2009-07-07 (Valerio)
* Backported from trunk: Fixed account verification and registration links in the Account Settings.
2009-07-07 (Adam)
* Backport fix for artifacts that appear when fading text in the contact list
with antialiasing enabled.
2009-07-07 (Adam)
* Backport unknown avatar picture courtesy of archdria.
2009-07-06 (Pano)
* Merged an updated Brazilian Portuguese translation by Maurício Arozi Moraes.
2009-07-06 (Valerio)
* Fix adding a contact which had added the user, resulting in having the new contact
appear as not having the user in his/her list.
2009-07-06 (dazjorz)
* Fix logging once and for all, hopefully, and comment about the remaining
edge cases I saw.
* Made the shadowed hummingbird by Adrià Arrufat (Swiftscythe) an overlay to
the user icon, changed the sizes a little.
* Updated the 'unknown avatar' another time, a new icon by Adrià :)
* Fixed crash in KMess::switchViewToContactList() and cleaned up that method and switchViewToInitialScreen().
* Cleaned up a part of KMessView::showContextMenu().
2009-07-05 (Valerio)
* Ensure the chat doesn't scroll when toggling the Chat Window Docks.
* Prevent crashing on exit when the LikeBack Bar trieds to move on a window that is
already deleted.
* Fixed wrong "no internet connection" message in the initial screen when a connection gets
established.
* Updated Italian translation.
* Removed the unused window title from an UI file.
2009-07-04 (Valerio)
* Fixed Contact List's text when using RTL languages.
* Improved the Contact Frame appearance: centered the contact's display picture, like the
user one is.
2009-07-01 (Ruben)
* DBus adapter is now built from XML (again).
2009-07-01 (Pano)
* Merged an updated Brazilian Portuguese translation by Sergio Rafael Lemke.
2009-06-30 (Pano)
* Merged an updated Dutch translation by Sjors Gielen.
* Merged an updated Catalan translation by Adrià Arrufat.
2009-06-30 (Adam)
* Change the icon of chat windows from the hummingbird to "user-identity" and "system-users"
for 1-1 and group chats respectively.
2009-06-30 (dazjorz)
* Imported the use of icon overlays from Amarok. Before, either the
hummingbird or a status icon would be displayed; now the hummingbird is
always displayed and a status icon is displayed as an overlay if possible.
* Fixed bug where an invalid XML log file would make the chat history dialog
go into an infinite loop.
* Fixed some thread issues; now only starting the thread after the documents
are given. Still an imperfect fix, if a new contact is chosen this could
potentially run into problems if the thread just selects a new document
that's currently being added, potentially.
* Fixed a crash probably caused by my earlier commit, only showing if full
debugging is enabled.
* Fixed selectNextFile() to not return the base file if startingNumber is not
zero, even if .1.xml doesn't exist and the base file does.
* Fixed #494: display size is not limited for notifications. Displays are now
limited at 96x96.
* Now using 'chronometer' as an icon for the history dialog.
* Finally replaced the kmess bag-over-head guy with a new icon. It's not
perfect, just quickly hacked together, but it will probably serve until the
Oxygen team comes with something better. :)
* Moved the overlay code to kmessshared, and used that same method also for
an overlay for the chat window, and dialogs like the chat history dialog.
2009-06-29 (Diederik)
* Fix a crash triggered by clients aborting while we're sending data.
2009-06-28 (Pano)
* Merged an updated German translation.
2009-06-25 (Pano)
* Merged an updated Dutch translation by Sander Pientka.
* Merged an updated Finnish translation by Antoni Hussy.
2009-06-24 (Adam)
* Revert r4901; author names must be wrapped in ki18n() calls.
2009-06-23 (Adam)
* Make the chat history dialog load any log files for a contact even if the base log
file doesn't exist.
* Remove the magic number for the max log file size; replaced with a static const long
in Chat class.
* Improve the debug messages in KMessShared::selectNextFile
* Fix bug where the base file would always be skipped for chat logging.
* Fade group names in contact list.
* Prevent wordwrapping of group names in the contact list.
* Fix logging bug caused by mishandling of the style tags in chatmessageview.cpp
2009-06-22 (Adam)
* Display emoticons in presence messages.
2009-06-22 (dazjorz)
* Fixed the logging issues people have been having, of logs suddenly
disappearing: the log writer no longer clobbers a file when it fails to find
the style tags; when an error occurs, the autosaver automatically tries to
save to the next new file.
* Removed a potential Heisenbug in the chat log writer, where the file would
not be truncated if debugging was disabled.
2009-06-15 (Adam)
* Reset cursor position in personal message input to 0 after setting text.
* No longer show notice-level MSN errors in the statusbar (print debug message instead).
* Fix warning about scaling a null pixmap in kmessviewdelegate.
2009-06-14 (Adam)
* Use QUuid for generating GUIDs in KMessShared. Much easier to understand.
* Fix #284 - require minimum 3 digits for generated ID's.
* Seed RNG properly with srand() in KMessShared.generateID().
* ChatMessageView now contains code to create its own popup menu. This simplifies ChatView and
ChatHistoryDialog a little.
* Fixed ticket #488 with the change immediately above.
2009-06-13 (Pano)
* Merged an updated Arabic translation by Ma'moun Diraneyya.
2009-06-12 (Adam)
* Add new Q&A's to the docbook for changing DP size in contact list and showing
own DP in the chat windows.
* Update the doc picture for export contact list.
* Added sections to the documentation for the chat history dialog and exporting
the contact list
* Add Help buttons to the Chat History dialog. Just need to add a section in the
docbook for it.
* Tiny changes in the export contact list dialog: fix a typo in "Friendlyname" and
update to use KMessageBox.
* Fixed a tiny spelling error in the docbook.
* Help buttons in dialogs now work: they are linked to their respective docbook sections.
* Fix #483: do not close the dialog when Help is clicked. Fixed this same issue in the
global settings dialog too. TODO: Use KDialog::setHelp() to link the help buttons to
their corresponding docbook entries.
2009-06-12 (dazjorz)
* Fixed #484: close-to-tray screenshots don't work with autohidden panels. If
the systray is invisible, no screenshot is displayed (reported by a LikeBack
user).
2009-06-11 (Adam)
* Enforce maximum size of 96x96 for display pictures in chat windows (reported by pano).
2009-06-11 (Valerio)
* Improved status restoring on reconnection.
2009-06-10 (Ruben)
* Connect immediately on autologin when network status is unknown. Reported by baghera.
2009-06-09 (Ruben)
* Removed LINK_DIRECTORIES from the konqueror plugin's CMakeList. Reported by RealNC.
2009-06-08 (dazjorz)
* Updated the Dutch translation a little more.
* Fixed bug where the passwordEdit_ would be cleared when first logging into
an account.
* Fixed adding emoticon links appearing in the history files. (Old history
files will still contain them, as will external HTML log files.)
2009-06-07 (Pano)
* Merged an updated Greek translation by Dimitrios Glentadakis.
* Merged an updated Dutch translation by dazjorz.
2009-06-04 (Ruben)
* Fixed disabling Handwriting and Winks buttons. Bug reported by mamoun.
* Fixed RTL rendering of contactlist items. Bug reported by mamoun.
2009-06-01 (dazjorz)
* Added .xd to the list of invalid country-code TLD's, and fixed a bug on
checking if a tld is valid: only lowercase tld's were listed as invalid, so
now calling .toLower() on the tld.
2009-05-31 (Pano)
* Merged an updated Greek translation by Dimitrios Glentadakis.
2009-05-31 (Ruben)
* Don't disable glow effect on contact's picture when he/she is typing.
2009-05-25 (Pano)
* Merged an updated Spanish translation by Mauricio Muñoz Lucero.
2009-05-24 (Diederik)
* Improved the configure script a bit to detect the default install prefix of 'KDE on MacOS'
2009-05-20 (Pano)
* Merged an updated Traditional Chinese translation by Yen-chou Chen.
2009-05-19 (Pano)
* Merged an updated Arabic translation by Ma'moun Diraneyya.
2009-05-18 (dazjorz)
* Fixed kmessview.ui, maketrans broke on it (this does not break string
freeze, since that string is untranslatable)
2009-05-17 (Pano)
* Merged an updated German translation.
* Merged an updated French translation by Scias.
* Merged an updated Hungarian translation by Pauli Henrik.
2009-05-17 (Valerio)
* Fixed displaying labels in the contact list.
2009-05-17 (Pano)
* Merged an updated Brazilian Portuguese translation by Maurício Arozi Moraes.
2009-05-17 (Adam)
* Made the status chooser toolbutton expand to take as much space
as it needs to display its caption fully.
2009-05-16 (Pano)
* Merged an updated Spanish translation by Mauricio Muñoz Lucero.
* Merged an updated German translation.
2009-05-16 (Valerio)
* Fixed chat and contact list alignment issues when using Right-to-Left languages.
* Added a nice fading effect to the contact list items.
* Added RTL languages support to the gradientElideLabel widget.
* Fixed typing when the Winks widget was chosen, didn't go back to the message editor.
* Added tooltips to the winks in the Winks widget.
* Moved the contact list's user status icon within the status chooser toolbutton.
2009-05-16 (Adam)
* Created a new GradientElideLabel class that adds a subtle
fade effect (as seen in Dolphin) to long labels: this works with rich text
and images too. It can stand in the place of any existing label and should
perform reasonably well thanks to Qt's compositing framework.
* Fixed ContactsWidget and ContactFrame to properly shrink/stretch the labels as necessary.
2009-05-16 (Pano)
* Merged an updated French translation by Scias.
2009-05-16 (Dario)
* Added an error message if the Triple DES Hash could not be computed.
Strings are in a I18N_NOOP, remember to translate after freeze.
2009-05-15 (Valerio)
* Changed default values for Plus formatting, it is now enabled by default.
* Fixed status reset when reconnecting.
* Fixed wrong signal connection in KMessView.
* Changed the CMake dependency order to build the KMess-Send plugin last.
* Fixed painter warnings in KMessView and improved its initialization order.
* Added a possible fix for the rare Chat History Dialog crashes.
2009-05-15 (dazjorz)
* Fixed AccountsManager not correctly updating the password if it changed and
was already present in the wallet.
* Fixed chat logging if the chat style changed: KMess will now write to a new
file instead of not writing a log at all.
* Fixed encoding issues with LikeBack again, for users which don't have utf8
as their local character set. (this matches with the current LikeBack
development version, but will work with the stable version too.)
2009-05-15 (Pano)
* Merged an updated Spanish translation by Mauricio Muñoz Lucero.
2009-05-15 (Adam)
* Fixed a compile bug that only occurred on some KDE installs.
2009-05-13 (Pano)
* Merged an updated Spanish translation by Mauricio Muñoz Lucero.
2009-05-13 (Adam)
* Fixed display of media string when contact signs in via XBox LIVE.
* Fixed Ctrl+F not showing the inline find box in a chat window: this was
due to KTextEdit consuming the Ctrl+F key sequence.
* Fixed bug where the global settings dialog displayed stale data in
the accounts list.
2009-05-12 (Ruben)
* Draw feedback bar at the upper left corner when the user has a RTL language.
2009-05-12 (Valerio)
* Fixed broken HTML entities in the emoticon widget's tooltips.
* Fixed ETA timer, now it shows up only when the first actual bytes are transferred.
* Fixed initial view's logo, it was being cropped when the window was too small.
* Removed glow effect from the "show email" link in the Contact List. It was ugly.
* Fixed Individuals group, it was being forced visible when it was completely empty like
a normal group.
* Set a minimum size on the Global Settings dialog's Events page, to allow seeing the
events right away (it was too small before).
* Moved the user status icon on the right, next to the status chooser.
* Removed the "Switching to another server..." login message, as it's useless for most users.
* Fixed the looks of the _underline_ _word_ _effect_ in chat.
2009-05-12 (dazjorz)
* Fixed bug if a custom emoticon had a dot plus two letters as a shortcut,
causing it to be seen as a geeklink.
--- 2.0beta2 released ---
2009-05-10 (dazjorz)
@@ -8,6 +362,7 @@
* Merged an updated Italian translation by Andrea Decorte.
* Merged an updated Finnish translation by Antony Hussi.
* Merged an updated Catalan translation by Adrià Arrufat.
2009-05-10 (Ruben)
* Fixed bug in Konqueror plugin. Thanks to Pano.
* Added Dutch translation for Konqueror Plugin.
@@ -375,6 +730,7 @@
2009-04-04 (Pano)
* Merged an updated Greek translation by Dimitrios Glentadakis.
* Merged an updated Arabic translation by Ma'moun Diraneyya.
2009-04-03 (dazjorz)
* Fixed "invalid read error" from Valgrind in MsnNotificationConnection
+1 -1
View File
@@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = KMess
PROJECT_NUMBER = 2.0-beta2
PROJECT_NUMBER = 2.0-rc1
OUTPUT_DIRECTORY = ./apidocs
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
+31 -1
View File
@@ -1,4 +1,34 @@
Changes between KMess 2.0-rc1 and 2.0-beta2:
--------------------------------------
- added Japanese translation by Daniel E. Moctezuma.
- added display of emoticons in presence messages.
- added status restoring on reconnection.
- added fading effect for long text labels and the contact list.
- changed the image used for unknown display pictures.
- changed the application windows icons.
- changed the system tray icon with one showing both the bird and the current status.
- fixed a crash triggered by clients aborting while we're sending data.
- fixed appearance when using right-to-Left languages, like Arabic.
- fixed bug preventing temporary accounts to be correctly cleaned up.
- fixed file selection errors in chat logging.
- fixed newly added contacts appearing as not having added the user in their list.
- improved appearance of the contact list when antialiasing is enabled.
- removed all experimental features which could not be finished in time.
- updated Arabic translation by Ma'moun Diraneyya.
- updated Brazilian Portuguese translation by Maurício Arozi Moraes and Sergio Rafael Lemke.
- updated Catalan translation by Adrià Arrufat.
- updated Finnish translation by Antony Hussi.
- updated Dutch translation by Sander Pientka and Sjors Gielen.
- updated French translation by Scias.
- updated German translation by Panagiotis Papadopoulos.
- updated Greek translation by Dimitrios Glentadakis.
- updated Hungarian translation by Pauli Henrik.
- updated Italian translation by Valerio Pilo.
- updated Slovak translation by Rastislav Krupanský.
- updated Spanish translation by Mauricio Muñoz Lucero.
- updated Traditional Chinese translation by Yen-chou Chen.
Changes between KMess 2.0-beta2 and 2.0-beta1:
--------------------------------------
- completed drag&drop support.
@@ -38,6 +68,7 @@ Changes between KMess 2.0-beta2 and 2.0-beta1:
- updated Greek translation by Dimitrios Glentadakis.
- updated Italian translation by Andrea Decorte.
- updated Spanish translation by Manuel Ramírez.
- updated Spanish translation by Mauricio Muñoz Lucero.
- updated Traditional Chinese translation by Yen-chou Chen.
- updated Traditional Chinese translation by the Tryneeds-Chinese Translation Platform.
@@ -52,7 +83,6 @@ Changes between KMess 2.0-beta1 and 2.0-alpha2:
- added Likeback support to collect user feedback, ported from Basket of KDE 3.
- added support to configure the toolbars and menus in the chat window.
- added contact list export dialog.
- added close button in the contact list search box.
- added context menu to the contact list, to open the contact menu with the left mouse too.
- added confirmation dialogs when the menu gets hidden with Ctrl+M.
- added confirmation dialogs when deleting custom emoticons.
-105
View File
@@ -1,105 +0,0 @@
# -*-shell-script-*-
[Meta]
RootName: @kmess.sourceforge.net/kmess:$SOFTWAREVERSION
DisplayName: KMess
ShortName: kmess
SoftwareVersion: 2.0beta2
Maintainer: The KMess Developers
Packager: Diederik van der Boor
Summary: MSN Messenger client for KDE
URL: http://www.kmess.org/
License: GNU General Public License, Version 2
AutopackageTarget: 1.0
[Description]
A MSN Messenger Client for KDE
KMess is a MSN Messenger client for Linux. It enables Linux
users to chat with friends online who are using MSN Messenger
in Windows or Mac OS. The strength of KMess is it's integration
with the KDE desktop environment, focus on MSN Messenger specific
features and an easy-to-use interface.
[BuildPrepare]
# The bogus deps solve our warnings about older distro incompatiblity
export APBUILD_BOGUS_DEPS='art_lgpl art_lgpl_2 dl expat fontconfig freetype GL ICE idn kdefx kdesu kwalletclient m nsl png pthread resolv SM util X11 Xcursor Xft Xi Xinerama Xmu Xrandr Xrender'
# Xrender is suggested by makeinstaller,
# the XScreenSaver stuff can be either in libXss or libXext
export APBUILD_STATIC='Xrender Xext Xss'
prepareBuild
[BuildUnprepare]
unprepareBuild
[Imports]
# tells autopackage to include all files created by "make install"
# make sure the symlink does not get installed. recreate it during Install
find . -name common -type d -o -type l -exec rm -Rf {} \;
echo "*" | import
[Prepare]
# KDE 4.1 is the minimum requirement for KMess 2
require @kde.org/kdelibs 4.1
# flash and cabextract are used for winks.
playWinks="1"
# test for cabextract
outputTest "cabextract"
if locateCommand -r "cabextract" "-v"; then
outputTestPass
else
outputTestFail
playWinks="0"
fi
# test for flash
# paths taken from Konqueror.
outputTest "flash player"
hasFlash="0"
for i in /usr/lib/browser-plugins $HOME/.netscape/plugins /usr/lib64/browser-plugins /usr/local/netscape/plugins /opt/mozilla/plugins /opt/mozilla/lib/plugins /opt/netscape/plugins /opt/netscape/communicator/plugins /usr/lib/netscape/plugins /usr/lib/netscape/plugins-libc5 /usr/lib/netscape/plugins-libc6 /usr/lib/mozilla/plugins /usr/lib64/netscape/plugins /usr/lib64/mozilla/plugins $MOZILLA_HOME/plugins
do
if [ -e "$i/libflashplayer.so" ]
then
hasFlash="1"
fi
done
if [ "$hasFlash" -eq "1" ];
then
outputTestPass
else
outputTestFail
playWinks="0"
fi
# notify user
if [ "$playWinks" -eq "0" ];
then
outputStatus "You need to have cabextract and a flash player installed to play winks"
# don't abort, KMess can operate without these deps.
fi
[Install]
# # force to use the KDE path, workarround for broken distro's
# # which don't support XDG/KDE stuff in /usr or /usr/local
# test "`id -u`" -eq 0 && export PREFIX="`getKdePrefix`" || true
outputStatus "Installing application..."
installExe bin/*
installData share/apps/ share/doc/ share/emoticons/ share/sounds/
linkFile --silent "`getKdePrefix`/share/doc/HTML/en/common" "$PREFIX/share/doc/HTML/en/kmess/common"
installIcon share/icons/hicolor/ share/icons/locolor/
installDesktop "Internet" share/applications/kde/kmess.desktop
installLocale share/locale/
[Uninstall]
uninstallFromLog
-9
View File
@@ -11,9 +11,6 @@
/* Define if debug output should be enabled */
#define KMESS_DEBUG ${KMESS_ENABLE_DEBUG_OUTPUT}
/* Define if the Relocatable Binary support should be enable */
#define ENABLE_BINRELOC ${KMESS_ENABLE_BINRELOC}
/* Define the fallback prefix */
#define KMESS_PREFIX "${CMAKE_INSTALL_PREFIX}"
@@ -23,11 +20,5 @@
/* Define if LikeBack is not needed */
#define KMESS_DISABLE_LIKEBACK ${KMESS_DISABLE_LIKEBACK}
/* Define if you have KPhone installed (for SIP voice chat) (currently unused) */
/* #define HAS_KPHONE 1 */
/* Define whether to enable MSN webcam support (HIGHLY EXPERIMENTAL) */
#define ENABLE_WEBCAM ${KMESS_ENABLE_WEBCAM}
/* Define whether to enable Ink support (using GIFLib) */
#define KMESS_ENABLE_INK ${HAVE_LIBGIF}
+1 -1
View File
@@ -3,7 +3,7 @@
cd `dirname $0`/..
# second sed expression fixes Mac OS X 10.4
appver="`cat kmess.lsm | grep Version: | sed -e 's/[^0-9]\+//' -e 's/Version:\( \)*//'`"
appver="`egrep 'SET.*KMESS_VERSION' CMakeLists.txt | sed -re 's/.*"([^"]+)".*/\1/'`"
date="`date +%Y%m%d`"
# Make sure we have the right repository
Vendored
+16 -18
View File
@@ -25,11 +25,22 @@
# Variables
#
# auto-detect default prefix
KDE4_PREFIX=""
DEFAULT_PREFIX="/usr/local"
if type -p kde4-config >/dev/null; then
KDE4_PREFIX=`kde4-config --prefix`
# auto-detect KDE Installation on the Mac.
KDE4_CONFIG=""
for i in `which kde4-config` /opt/local/bin/kde4-config
do
if [ -x "$i" ]; then
KDE4_CONFIG="$i"
break
fi
done
# auto-detect default prefix
if [ -n "$KDE4_CONFIG" ]; then
KDE4_PREFIX=`$KDE4_CONFIG --prefix`
DEFAULT_PREFIX="$KDE4_PREFIX"
fi
@@ -39,7 +50,6 @@ BUILD_TYPE="relwithdebinfo"
BUILD_DIR="build"
REAL_BUILD_DIR=""
DEBUG=0
BINRELOC=0
# Globals
cd `dirname $0`
@@ -71,7 +81,6 @@ Installation directories:
Optional Features:
--enable-debug-output enable debugging output. default=no
--enable-binreloc enable binary relocation support. default=no
--build-dir=PATH path to store the build files. default: ./build
--build-type=TYPE define the build configuration to use, values:
release - standard release
@@ -96,7 +105,7 @@ After running ./configure, you can type 'make' to build this project.
else
echo " WARNING:
kde4-config was not found. Please verify that
kde4-config was not found. Please verify that
you've installed the KDE 4 development packages!
"
fi
@@ -140,7 +149,6 @@ function run_cmake
echo "command: cmake -D CMAKE_INSTALL_PREFIX=$PREFIX \ "
echo " -D CMAKE_BUILD_TYPE=$BUILD_TYPE \ "
echo " -D KMESS_DEBUG_OUTPUT=$DEBUG \ "
echo " -D KMESS_ENABLE_BINRELOC=$BINRELOC \ "
echo " "$SRC_DIR" "
echo ""
@@ -148,7 +156,6 @@ function run_cmake
cmake -D CMAKE_INSTALL_PREFIX=$PREFIX \
-D CMAKE_BUILD_TYPE=$BUILD_TYPE \
-D KMESS_DEBUG_OUTPUT=$DEBUG \
-D KMESS_ENABLE_BINRELOC=$BINRELOC \
"$SRC_DIR" \
&& cmake_ok || cmake_error
}
@@ -159,16 +166,11 @@ function cmake_ok
# collect all settings
local HAS_XSS="no (extension not detected)"
local HAS_DEBUG="no (good!)"
local HAS_BINRELOC="no (only available on Linux)"
if [ $DEBUG = "1" ]; then
HAS_DEBUG="yes (KMess will be slow!)"
fi
if [ $BINRELOC = "1" ]; then
HAS_BINRELOC="yes"
fi
if grep -q '^#define HAVE_XSCREENSAVER 1$' "config-kmess.h"; then
HAS_XSS="yes"
fi
@@ -182,7 +184,6 @@ function cmake_ok
# Install prefix: $PREFIX
# Auto-away feature: $HAS_XSS
# Debugging messages: $HAS_DEBUG
# Binary relocatable: $HAS_BINRELOC
# Build type: $BUILD_TYPE
# Build directory: $BUILD_DIR
#
@@ -193,7 +194,6 @@ function cmake_ok
# cmake -D CMAKE_INSTALL_PREFIX=$PREFIX \\
# -D CMAKE_BUILD_TYPE=$BUILD_TYPE \\
# -D KMESS_DEBUG_OUTPUT=$DEBUG \\
# -D KMESS_ENABLE_BINRELOC=$BINRELOC \\
# \"$SRC_DIR\"
#
" > $makefile
@@ -214,7 +214,6 @@ function cmake_ok
Install prefix: $PREFIX
Auto-away feature: $HAS_XSS
Debugging messages: $HAS_DEBUG
Binary relocatable: $HAS_BINRELOC
Build type: $BUILD_TYPE
@@ -262,7 +261,7 @@ Please run cmake directly, for example:
fi
# Parse the arguments
longopts="help,prefix:,build-type:,build-dir:,build-folder:,enable-binreloc,enable-debug-output"
longopts="help,prefix:,build-type:,build-dir:,build-folder:,enable-debug-output"
TEMP=`getopt --name=configure \
--options h \
--longoptions "$longopts" -- "$@"`
@@ -280,7 +279,6 @@ Please run cmake directly, for example:
-h|--help) print_help; exit 0 ;;
--prefix) PREFIX=$2; shift 2 ;;
--enable-debug-output) DEBUG=1; shift ;;
--enable-binreloc) BINRELOC=1; shift ;;
--build-type) BUILD_TYPE="$2"; shift 2 ;;
--build-dir) BUILD_DIR="$2"; shift 2 ;;
--builddir|--build-directory|--build-folder) BUILD_DIR="$2"; shift 2 ;; # be forgiving with small errors.
View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

+1 -2
View File
@@ -3,7 +3,6 @@ KDE4_INSTALL_ICONS( ${ICON_INSTALL_DIR} )
SET( KMESS_ICON_INSTALL_DIR ${DATA_INSTALL_DIR}/kmess/icons/hicolor/16x16 )
# If we're compiling in debug mode, also add the LikeBack icons
IF( ${KMESS_ENABLE_DEBUG_OUTPUT} EQUAL 1 )
INSTALL( FILES likeback_bug.png DESTINATION ${KMESS_ICON_INSTALL_DIR}/actions )
@@ -12,4 +11,4 @@ IF( ${KMESS_ENABLE_DEBUG_OUTPUT} EQUAL 1 )
INSTALL( FILES likeback_like.png DESTINATION ${KMESS_ICON_INSTALL_DIR}/actions )
ENDIF( ${KMESS_ENABLE_DEBUG_OUTPUT} EQUAL 1 )
INSTALL( FILES gnomemeeting.png DESTINATION ${KMESS_ICON_INSTALL_DIR}/apps )
INSTALL( FILES kmess-shadow.png DESTINATION ${KMESS_ICON_INSTALL_DIR}/apps )
Binary file not shown.

Before

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

+81 -1
View File
@@ -582,7 +582,7 @@
<sect2 id="contactlist-display">
<title>Changing the Gontact List Appearance</title>
<title>Changing the Contact List Appearance</title>
<sect3 id="contactlist-display-grouping">
<title>Sorting Contacts</title>
@@ -1011,6 +1011,64 @@
</para>
</sect2>
</sect1>
<sect1 id="using-chat-history">
<title>Using Chat History</title>
<para>
If chat logging is enabled the Chat History dialog will display
all of your saved chats with your contacts. You can select which contact's chat history to view and then you can
choose to filter the saved chats. Filtering allows you to select a specific chat to view, or, you can view all
chats that occurred between two dates.
</para>
<para>
To access the chat history dialog you can:
<itemizedlist>
<listitem><para>Click with the &RMB; on a contact in the contact list and choose <menuchoice> <guimenu>Show Chat History...</guimenu> </menuchoice>, or,</para></listitem>
<listitem><para>Choose <menuchoice> <guimenu>Actions</guimenu> <guimenuitem>Show Chat History...</guimenuitem> </menuchoice> from the contact list window.</para></listitem>
</itemizedlist>
</para>
<para>
Note: Chat logging is not enabled by default; see <xref linkend="settings-account-logging" /> for information on enabling it.
</para>
<screenshot>
<screeninfo>The &kapp; chat history dialog</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="chathistorydialog.png" format="PNG" /></imageobject>
<textobject><phrase>The &kapp; chat history dialog</phrase></textobject>
</mediaobject>
</screenshot>
</sect1>
<sect1 id="using-export-list">
<title>Exporting your Contact List</title>
<para>
Occasionally it is helpful to export your contact list. &kapp; supports export of your contact list into either CSV
or XML format.
</para>
<para>
Choose <menuchoice><guimenu>Actions</guimenu><guimenuitem>Export Contact List...</guimenuitem></menuchoice> from the contact list window to open
the Export dialog.
</para>
<para>
From this dialog you can choose which contacts you wish to export (the default is all contacts) as well as the pieces of data you wish to export. &kapp; allows to
export three pieces of data: The contact handle, their friendly name, and their current personal message.
</para>
<para>
Finally, select which filetype to export to and choose <guibutton>Export...</guibutton>.
</para>
<screenshot>
<screeninfo>The &kapp; export contact list dialog</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="exportlist-dialog.png" format="PNG" /></imageobject>
<textobject><phrase>The &kapp; export contact list dialog</phrase></textobject>
</mediaobject>
</screenshot>
</sect1>
</chapter>
@@ -1961,6 +2019,24 @@
</answer>
</qandaentry>
<qandaentry>
<question><para>How do I change the size of the display pictures in the contact list?</para></question>
<answer>
<para>
From the contact list window, go to <menuchoice><guimenu>View</guimenu> <guimenuitem>Display Pictures Size</guimenuitem></menuchoice> and choose the size you would like.
</para>
</answer>
</qandaentry>
<qandaentry>
<question><para>How do I show my own display picture in the chat window?</para></question>
<answer>
<para>
You can set this by going to <menuchoice><guimenu>Account Settings</guimenu><guimenuitem>Chatting</guimenuitem> <guimenuitem>Behaviour</guimenuitem> <guimenuitem>Display your own picture in the chat window</guimenuitem></menuchoice>.
</para>
</answer>
</qandaentry>
</qandaset>
</chapter>
@@ -2096,6 +2172,8 @@
<member>Vincenzo Reale (More Italian) <email>smart2128@baslug.org</email></member>
<member>Andrea Decorte (More Italian) <email>adecorte@gmail.com</email></member>
<member>Daniel E. Moctezuma (Japanese) <email>shinsen27@gmail.com</email></member>
<member>Park Dong Cheon (Korean) <email>pdc@kaist.ac.kr</email></member>
<member>Øyvind Sæther (Norsk Bokmål) <email>oyvind@sather.tk</email></member>
@@ -2114,6 +2192,8 @@
<member>Juan Pablo González Tognarelli (More Spanish) <email>jotapesan@gmail.com</email></member>
<member>Alexis Daniel Medina Medina (More Spanish) <email>alexismedina@gmail.com</email></member>
<member>Manuel Ramírez (More Spanish) <email>elpreto@kde.org.ar</email></member>
<member>Mauricio Muñoz Lucero (More Spanish) <email>real.mml@gmail.com</email></member>
<member>Christian Lundgren (Swedish) <email>zeflunk@gmail.com</email></member>
<member>Mattias Newzella (More Swedish) <email>newzella@gmail.com</email></member>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 44 KiB

+3
View File
@@ -0,0 +1,3 @@
[Project]
Name=KMess
Manager=KDevCMakeManager
-2
View File
@@ -69,8 +69,6 @@
<path>build/kmess/moc_chatstylepage.cpp</path>
<path>build/kmess/moc_emailpage.cpp</path>
<path>build/kmess/moc_kmessapplication.cpp</path>
<path>build/kmess/moc_webapplicationp2p.cpp</path>
<path>build/kmess/moc_webcamtransferp2p.cpp</path>
<path>build/kmess/ui_accountswidgetinterface.h</path>
<path>build/kmess/ui_addemoticondialoginterface.h</path>
<path>build/kmess/ui_alertssettings.h</path>
-11
View File
@@ -1,11 +0,0 @@
Begin4
Title: KMess
Version: 2.0beta2
Entered-date: 2009-05-10
Description: A MSN Messenger / Windows Live Messenger client for KDE
Keywords: KDE, X11, desktop, WLM, MSN, Live, Messenger
Author: KMess Developers Team <project@kmess.org>
Primary-site: http://www.kmess.org/
Platforms: Linux (and most unices) and Windows; requires KDE (at least 4.0)
Copying-policy: GNU General Public License 2.0
End
-425
View File
@@ -1,425 +0,0 @@
# KMess spec file to build RPM packages
#
# Based on work from Pascal Bleser <guru@unixtech.be>,
# Simon Eisenmann <http://www.longsleep.org/projects/plone>,
# and the smb4k project
#
# RPM spec options are well explained at
# http://fedora.redhat.com/participate/developers-guide/ch-rpm-building.html
# and /usr/lib/rpm/macros
#
# PACKAGE SETTINGS
#
%define kmess_version 2.0beta2
%define kmess_tar_version 2.0beta2
%define rpm_release 1
%define with_debug 0
%define doc_files AUTHORS COPYING FEATURES INSTALL NEWS README TODO
# For debugging this specfile
%define debug_rpmbuild 0
# DETECT DISTRO
#
%define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0)
%define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0)
%define is_redhat %(test -e /etc/redhat-release && echo 1 || echo 0)
%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)
%define is_slackware %(test -e /etc/slackware-version && echo 1 || echo 0)
%define is_debian %(test -e /etc/debian_version && echo 1 || echo 0)
# slackware is not an rpm distro, but "rpm2tgz" should do the trick
# debian does not use RPM, but rpmbuild can be abused too
# Many redhat based distro's still have /etc/redhat-release arround:
%if %is_redhat
%define is_redhat %(grep -q "Red Hat" /etc/redhat-release && echo 1 || echo 0)
%endif
# DETECT KDE VERSION
#
# The cut for '-' is used to fix versions like "3.1-10" done by Red Hat
#
%define kde_config %(test -e /usr/bin/kde4-config && echo "/usr/bin/kde4-config" || echo "kde4-config")
%define kde_version %(%{kde_config} --version | grep '^KDE:' | cut -f2 -d" " | cut -f1 -d"-" )
%define kde_major_version %(echo "%{kde_version}" | cut -f1-2 -d.)
%define kde_vernum %(echo "%{kde_major_version}" | tr -d '.')
# DETECT RUNTIME PATHS
%define kde_prefix %(%{kde_config} --prefix)
%define qtlib_prefix %(%{kde_config} --qt-libraries)
# DETECT KDE PACKAGE
#
# Use rpm to locate the packages for various KDE components based on your system.
#
%define kdelibs_package %(rpm -qf %{kde_prefix}/lib/libkdeui.so.5 | cut -f1 -d"-")
%define qtgui_package %(rpm -qf %{qtlib_prefix}/libQtGui.so.4 | cut -f1 -d"-")
%define kdelibs_dev_package %(rpm -qf %{kde_prefix}/lib/libkdeui.so | cut -f1-2 -d"-")
%define qtgui_dev_package %(rpm -qf %{qtlib_prefix}/libQtGui.so | cut -f1-2 -d"-")
%if ! %(echo %{kdelibs_package} | grep -q 'not owned by any package' ; echo $?)
%define kdelibs_package libkde4
%endif
%if ! %(echo %{qtgui_package} | grep -q 'not owned by any package' ; echo $?)
%define qtgui_package libqt4
%endif
%if ! %(echo %{kdelibs_dev_package} | grep -q 'not owned by any package' ; echo $?)
%define kdelibs_dev_package libkde4-devel
%endif
%if ! %(echo %{qtgui_dev_package} | grep -q 'not owned by any package' ; echo $?)
%define qtgui_dev_package libqt4-devel
%endif
# DETECT AUTOPACKAGE COMPILER
#
# support "build on newer, run on older" development)
# see http://autopackage.org/aptools.html for details
#
%define has_apgcc %(test -e /usr/bin/apg++ && echo 1 || echo 0)
# DISTRO SPECIFIC STUFF
#
# Set the rpm file suffix and name to add in the file.
# First define the defaults
#
%define distro Unknown
%define release_suffix %{rpm_release}
%define is_rpm_distro 1
%if %with_debug
%define release_suffix %{rpm_release}-debug
%endif
%if %is_fedora
%define fedora_version %(rpm -q --queryformat '%{VERSION}' fedora-release)
%define fedora_vernum %(echo "%fedora_version" | tr -d '.')
%define release_suffix %{rpm_release}.FedoraCore%{fedora_vernum}.kde%{kde_vernum}
%define distro Fedora Core %{fedora_version}
%endif
%if %is_mandrake
%define mandrake_version %(cat /etc/mandrake-release | cut -f4 -d" ")
%define mandrake_vernum %(echo "%mandrake_version" | tr -d '.')
%define release_suffix %{rpm_release}.MandrakeLinux%{mandrake_num}.kde%{kde_vernum}
%define distro Mandrake Linux %{mandrake_version}
%endif
%if %is_redhat
%define redhat_version %(rpm -q --queryformat '%{VERSION}' redhat-release)
%define redhat_vernum %(echo "%redhat_version" | tr -d '.')
%define release_suffix %{rpm_release}.RedhatLinux%{redhat_vernum}.kde%{kde_vernum}
%define distro Red Hat Linux %{redhat_version}
%endif
%if %is_suse
%define is_opensuse %(grep -q openSUSE /etc/SuSE-release && echo 1 || echo 0)
%define suse_version %(grep VERSION /etc/SuSE-release | cut -f3 -d" ")
%define suse_vernum %(echo "%suse_version" | tr -d '.')
%if %is_opensuse
%define release_suffix %{rpm_release}.openSUSE%{suse_vernum}.kde%{kde_vernum}
%define distro openSUSE %{suse_version}
%else
%define release_suffix %{rpm_release}.SuSELinux%{suse_vernum}.kde%{kde_vernum}
%define distro SuSE Linux %{suse_version}
%endif
%endif
%if %is_slackware
%define slackware_version %(cat /etc/slackware-version | cut -f2 -d" " | cut -f1-2 -d".")
%define slackware_vernum %(echo "%slackware_version" | tr -d '.')
%define release_suffix %{rpm_release}SlackwareLinux%{slackware_vernum}kde%{kde_vernum}
%define distro Slackware Linux %{slackware_version}
%define is_rpm_distro 0
%endif
%if %is_debian
%define debian_version %(cat /etc/debian_version)
%define debian_vernum %(echo "%debian_version" | tr -d '.')
%define release_suffix %{rpm_release}debian%{debian_vernum}kde%{kde_vernum}
%define distro Debian Linux %{debian_version}
%define is_rpm_distro 0
%endif
# get current folder (or use ${RPM_SOURCE_DIR} ??)
%define curdir %(pwd)
# SET META DATA
#
# Finally enter the package meta data.
# This uses all the detected settings above.
#
# The 'Requires' and 'BuildRequires' are automatically
# auto-completed with all libraries our compiled binary links to.
#
Summary: MSN Messenger / Windows Live Messenger client for KDE
Name: kmess
Version: %{kmess_version}
Release: %{release_suffix}
Source: kmess-%{kmess_tar_version}.tar.gz
URL: http://www.kmess.org/
Group: Networking/Instant Messaging
Packager: KMess Developers Team <project --at-- kmess.org>
License: GPL
Distribution: %distro
BuildRequires: cmake >= 2.4.5
BuildRoot: %{_tmppath}/build-kmess-%{kmess_version}
%if %kdelibs_package
Requires: %{kdelibs_package} >= 4.0
BuildRequires: %{kdelibs_dev_package} >= 4.0
%endif
%if %qtgui_package
Requires: %{qtgui_dev_package} >= 4.3
BuildRequires: %{qtgui_package} >= 4.3
%endif
%description
KMess is a MSN Messenger / Windows Live Messenger client for Linux.
It enables Linux users to chat with friends online who are using
MSN Messenger in Windows or Mac OS. The strength of KMess is it's
integration with the KDE desktop environment, focus on MSN Messenger
specific features and an easy-to-use interface.
Authors:
--------
Mike K. Bennett <mkb137 --at-- users.sourceforge.net>
Michael Curtis <mdcurtis --at-- users.sourceforge.net>
Jan Toenjes <jan.toenjes --at-- web.de>
Diederik van der Boor <vdboor --at-- codingdomain.com>
Richard Conway <richardconway --at-- users.sourceforge.net>
Valerio Pilo <amroth --at-- coldshock.net>
%prep
# BUILD CONFIGURATION
#
# Extract the files, configure the build
#
# Be verbose
set +x; echo -e "\n\nStarting build for KMess package..."; set -x
set +x; echo -e "\n\n\033[1;34mExtracting files...\033[0m\n"; set -x
# Extract the files
%setup -q -n "kmess-%{kmess_tar_version}"
# Be verbose again
set +x; echo -e "\n\n\033[1;34mStarting configure...\033[0m\n"; set -x
# Configure the build
./configure --prefix=%{kde_prefix} --build-dir=rpmbuild \
%if %with_debug
--build-type=debugfull --enable-debug-output
%else
--build-type=relwithdebinfo
%endif
%build
# COMPILING
#
# compiles everything using make
#
set +x; echo -e "\n\n\033[1;34mStarting make...\033[0m\n"; set -x
# Setup for parallel builds (no cpus + 1)
numprocs=`egrep -c ^cpu[0-9]+ /proc/stat || :`
if [ -z "$numprocs" -o "$numprocs" = "0" ]; then
numprocs=1
fi
# Start make
cd rpmbuild
#%{__make} -j$numprocs
%install
# INSTALLING
#
# Install all files in a separate folder.
# Track the files to build the package later.
#
# Be verbose again
set +x; echo -e "\n\n\033[1;34mStarting make install...\033[0m\n"; set -x
# Remove old build install root
%{__rm} -rf "${RPM_BUILD_ROOT}"
mkdir "${RPM_BUILD_ROOT}" # required by some distro's, slackware for always builds in /usr/src/rpms/BUILD
%if %debug_rpmbuild
mkdir -p ${RPM_BUILD_ROOT}/usr/bin/
cp %(kde4-config --prefix)/bin/kmess ${RPM_BUILD_ROOT}/usr/bin/kmess
echo "install/strip:" > Makefile
%else
%if %with_debug
cd rpmbuild
%{__make} install DESTDIR="${RPM_BUILD_ROOT}"
%else
cd rpmbuild
%{__make} install/strip DESTDIR="${RPM_BUILD_ROOT}"
%endif
%endif
# Add package description file for slackware
%if %is_slackware
mkdir "${RPM_BUILD_ROOT}/install"
cat <<"END" > "${RPM_BUILD_ROOT}/install/slack-desc"
# Slackware package description file.
|-----handy-ruler------------------------------------------------------|
%{name}: KMess %{kmess_version} MSN Messenger Client for KDE
%{name}:
%{name}: KMess is a MSN Messenger / Windows Live Messenger client for Linux.
%{name}: It enables Linux users to chat with friends online who are using
%{name}: MSN Messenger in Windows or Mac OS. The strength of KMess is it's
%{name}: integration with the KDE desktop environment, focus on MSN Messenger
%{name}: specific features and an easy-to-use interface.
%{name}:
%{name}: Package Created By: KMess development team
%{name}:
END
%endif
##' fix syntax for vim
# Add package description file for debian
%if %is_debian
mkdir "${RPM_BUILD_ROOT}/DEBIAN"
cat <<"END" > "${RPM_BUILD_ROOT}/DEBIAN/control"
Package: %{name}
Version: %{version}
Section: kde
Priority: optional
Architecture: i386
Depends: kdelibs5 (>=5:%{kde_major_version}.0)
Maintainer: The KMess Developers
Description: KMess is a MSN Messenger / Windows Live Messenger client for Linux.
.
It enables Linux users to chat with friends online
who are using MSN Messenger in Windows or Mac OS.
The strength of KMess is it's integration with the
KDE desktop environment, focus on MSN Messenger
specific features and an easy-to-use interface.
END
##' fix syntax for vim
cat <<"END" > "${RPM_BUILD_ROOT}/DEBIAN/changelog"
kmess (%{version}-1) unstable; urgency=low
* Debian package build with rpmbuild
-- Diederik van der Boor <vdboor@codingdomain.com> %(date --rfc-2822)
END
echo "%{doc_files}" | tr ' ' '\n' > "${RPM_BUILD_ROOT}/DEBIAN/docs"
%endif
# Build the .deb package from the RPM build root
%if %is_debian
%define deb_filename %{curdir}/%{name}_%{version}-%{release}_i386.deb
set +x; echo -e "\n\n\033[1;34mBuilding Debian package...\033[0m\n"; set -x
dpkg-deb --build "${RPM_BUILD_ROOT}" "%{deb_filename}"
%endif
# Build the .tgz package from the RPM build root
%if %is_slackware
%define slack_filename %{curdir}/kmess-%{version}-%{_target_cpu}-%{release_suffix}.tgz
set +x; echo -e "\n\n\033[1;34mBuilding Slackware package...\033[0m\n"; set -x
cd "$RPM_BUILD_ROOT"
makepkg --linkadd y --chown y "%{slack_filename}"
%endif
# Install done Build a file list for %files
# This is done after 'makepkg --linkadd y' because RPM complains otherwise in Slackware.
cd "$RPM_BUILD_ROOT"
find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > "$RPM_BUILD_DIR/file.list.kmess"
find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> "$RPM_BUILD_DIR/file.list.kmess"
%if %is_rpm_distro
find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> "$RPM_BUILD_DIR/file.list.kmess"
%endif
# not using %{_arch} here, because that's always i386
%define rpm_filename %{_rpmdir}/%{_target_cpu}/%{name}-%{version}-%{release}.%{_target_cpu}.rpm
%if %is_rpm_distro
set +x
echo -e "\n\n\033[1;34mCollecting file list for RPM package...\033[0m\n"
cat "$RPM_BUILD_DIR/file.list.kmess"
set -x
echo -e "\n\n\033[1;34mBuilding RPM package...\033[0m\n"; set -x
%endif
# FILES TO PACKAGE
#
%files -f ../file.list.kmess
%doc ChangeLog %{doc_files}
%clean
# CLEANUP
#
# clean up temporary folders
%{__rm} -rf "${RPM_BUILD_ROOT}"
%{__rm} -rf "${RPM_BUILD_DIR}/%{name}-%{version}/"
%{__rm} -f "$RPM_BUILD_DIR/file.list.kmess"
# Disable command displaying
set +x
# Display the filename that was created
%if %is_rpm_distro
echo -e "\n\n\033[1;34mThe following package was created:\033[0m\n\n %{rpm_filename}\n\n"
%endif
%if %is_slackware
%{__rm} -f "%{rpm_filename}"
echo -e "\n\n\033[1;34mThe following package was created:\033[0m\n\n %{slack_filename}\n\n"
%endif
%if %is_debian
%{__rm} -f "%{rpm_filename}"
echo -e "\n\n\033[1;34mThe following package was created:\\033[0mn\n %{deb_filename}\n\n"
%endif
# RPM CHANGELOG
#
# Use `date +"%a %b %d %Y"` to generate the dates.
#
%changelog
* Wed Apr 30 2008 Valerio Pilo <valerio --at-- kmess.org>
- Updated the specfile for KMess 2.0
- Changed the build process to use CMake
* Wed May 11 2005 Diederik van der Boor <vdboor --at-- codingdomain.com>
- Updated dependencies
- Fixed slackware building support
* Sun May 08 2005 Diederik van der Boor <vdboor --at-- codingdomain.com> 1.4pre1
- new package
+321
View File
@@ -0,0 +1,321 @@
#!/usr/bin/perl
use strict;
use warnings;
use File::Copy;
my ( $kde3home, $kde4home );
my $HOME = $ENV{HOME};
# Process arguments
if( @ARGV == 1 )
{
# if it ends with "help" or a question mark
if( $ARGV[0] =~ /(?:help|\?)$/i )
{
print usage();
exit 1;
}
$kde3home = $ARGV[0];
}
elsif( @ARGV == 2 )
{
# if either of the two ends with "help" or a question mark
if( $ARGV[0] =~ /(?:help|\?)$/i || $ARGV[1] =~ /(?:help|\?)$/i )
{
print usage();
exit 1;
}
$kde3home = $ARGV[0];
$kde4home = $ARGV[1];
}
elsif( @ARGV > 2 )
{
# too many arguments
print usage();
exit 1;
}
# Find the old KDE3 directory
if( !defined( $kde3home ) )
{
my @kdeconfig = `kde-config --version 2>/dev/null`;
if( !@kdeconfig || $kdeconfig[1] !~ /^KDE: 3\./ )
{
# not KDE3 kde-config. Try kde3-config
@kdeconfig = `kde3-config --version 2>/dev/null`;
if( !@kdeconfig || $kdeconfig[1] !~ /^KDE: 3\./ )
{
# no kde3-config. Check ~/.kde3
if( ! -e "$HOME/.kde3" || !is_kde3_kmessrc( "$HOME/.kde3/share/config/kmessrc" ) )
{
# ~/.kde3 doesn't exist or is not kde3
# (we assume the kde3 install has a valid kmessrc file)
# check ~/.kde
if( ! -e "$HOME/.kde" || !is_kde3_kmessrc( "$HOME/.kde/share/config/kmessrc" ) )
{
# Can't find kde3 homedir.
warn("Could not find the KDE3 home directory.\n");
warn("Please re-run this script with the KDE3 home directory as the first argument, or install kde-config / kde3-config.\n");
die("See $0 --help for more information.\n");
}
else
{
$kde3home = "$HOME/.kde";
}
}
else
{
$kde3home = "$HOME/.kde3";
}
}
else
{
$kde3home = `kde3-config --localprefix`;
1 while chomp $kde3home;
}
}
else
{
$kde3home = `kde-config --localprefix`;
1 while chomp $kde3home;
}
}
# Find the new KDE4 directory
if( !defined( $kde4home ) )
{
my @kdeconfig = `kde4-config --version 2>/dev/null`;
if( !@kdeconfig || $kdeconfig[1] !~ /^KDE: 4\./ )
{
# no kde4-config. Try kde-config
@kdeconfig = `kde-config --version 2>/dev/null`;
if( !@kdeconfig || $kdeconfig[1] !~ /^KDE: 4\./ )
{
# not KDE4 kde-config. Check ~/.kde4
if( ! -e "$HOME/.kde4" || ! -e "$HOME/.kde4/share" )
{
# ~/.kde4 doesn't exist
# check ~/.kde
if( ! -e "$HOME/.kde" || ! -e "$HOME/.kde/share" )
{
# Can't find kde4 homedir.
warn("Could not find the KDE4 home directory.\n");
warn("Please re-run this script with the KDE4 home directory as the second\n");
warn("argument, or install kde-config / kde4-config. If you re-run the\n");
warn("script, this is what was detected as the first argument:\n$kde3home\n");
die("See $0 --help for more information.\n");
}
else
{
if( $kde3home eq "$HOME/.kde" || $kde3home eq "$HOME/.kde/" )
{
warn("WARNING: I have not detected a seperate directory for KDE 4. I did,\n");
warn("however, find .kde in your home directory, but that was also detected as\n");
warn("your KDE3 directory. If you haven't installed KDE4 or run any KDE4\n");
warn("application yet, please press Ctrl+C and do so now, then re-run this\n");
warn("script afterwards; alternatively, try installing kde4-config to make\n");
warn("sure. If you don't press Ctrl+C, I will assume the home directory for\n");
warn("both your KDE3 and KDE4 installation is ~/.kde.\n");
sleepCounter( 30 );
$kde4home = "$HOME/.kde";
}
}
}
else
{
$kde4home = "$HOME/.kde4";
}
}
else
{
$kde4home = `kde-config --localprefix`;
1 while chomp $kde4home;
}
}
else
{
$kde4home = `kde4-config --localprefix`;
1 while chomp $kde4home;
}
}
# Confirm
print "KDE 3 local prefix: $kde3home\n";
print "KDE 4 local prefix: $kde4home\n";
print "If this is incorrect, please press Ctrl-C within 5 seconds...\n";
sleepCounter( 5 );
print "Okay, going on with the merge.\n";
# create $kde4home/share/apps/kmess
foreach( "$kde4home", "$kde4home/share", "$kde4home/share/apps", "$kde4home/share/apps/kmess" )
{
if( ! -d $_ ) {
mkdir $_ or die("Couldn't create directory $_: $!");
}
}
my $kmess2dir = "$kde4home/share/apps/kmess";
# Find customImageIndex for every profile
my $kmessrc = "$kde3home/share/config/kmessrc";
open my $kmessrchandle, $kmessrc or die("Couldn't open KDE3 kmessrc ($kmessrc): $!");
my @accounts;
my %customimages;
my $in_profile;
while( <$kmessrchandle> )
{
# Find [Profile
if( /^\[Profile_(.+)\]$/ )
{
$in_profile = $1;
push @accounts, $1;
next;
}
elsif( /^\[/ )
{
undef $in_profile;
next;
}
if( !$in_profile )
{
next;
}
if( /^customimageindex=(\d+)$/i )
{
$customimages{ $in_profile } = $1;
next;
}
}
close $kmessrchandle;
foreach my $handle ( keys %customimages )
{
my $imageid = $customimages{$handle};
my $accountdir = "$kmess2dir/$handle";
# Create an account directory for this account if it doesn't exist yet
if( ! -e $accountdir )
{
mkdir $accountdir or die "Couldn't create directory for handle $handle ($accountdir): $!";
}
if( ! -e "$accountdir/displaypics" )
{
mkdir "$accountdir/displaypics" or die "Couldn't create displaypics directory for handle $handle: $!";
}
# Move the display picture to a new nice location
my $oldPicturePath = "$kde3home/share/apps/kmess/msnpicture-$handle-$imageid.png";
if( -e $oldPicturePath )
{
my $newPicturePath = "$accountdir/displaypics/merged-msnpicture-$imageid.png";
copy( $oldPicturePath, $newPicturePath ) or die("Couldn't copy $oldPicturePath to $newPicturePath: $!\n");
# add it to the settings
my $accountsettings = "$accountdir/settings";
open my $accountsettingshandle, '>>', $accountsettings or die("Couldn't open $accountsettings: $!");
print $accountsettingshandle "displayPicturePath=$newPicturePath\n";
}
else
{
warn("Couldn't merge your avatar: $oldPicturePath doesn't exist.\n");
}
}
# merge custom emoticons
foreach my $handle (@accounts)
{
my $olddir = "$kde3home/share/apps/kmess/customemoticons/$handle";
if( -e $olddir )
{
my $newdir = "$kde4home/share/apps/kmess/$handle/customemoticons";
if( ! -e $newdir )
{
mkdir $newdir or die("Couldn't create $newdir: $!");
}
opendir my($dirh), $olddir;
while( my $file = readdir( $dirh ) )
{
next if( $file eq "." || $file eq ".." );
copy( "$olddir/$file", $newdir ) or warn("Couldn't copy $olddir/$file to $newdir: $!\n");
}
closedir $dirh;
}
}
print "The merge is complete.\n";
print "You can now continue installing KMess 2.0. When you log in, your display\n";
print "picture and custom emoticons should be preserved.\n";
exit 0;
# Helper methods
sub usage
{
"Syntax:
$0 [kde3home [kde4home]]
This script merges some of the data from KMess 1.5 (KDE3) to KMess 2.0 (KDE4).
If kde3home is not given, the script will check with kde-config; if that script
does not exist or it's not for KDE3 it checks with kde3-config, and falls back
to ~/.kde3 then ~/.kde. If kde4home is not given, the script will check with
kde4-config; if that script does not exist it will check with kde-config if
it's for KDE4, and fall back to ~/.kde4 then ~/.kde.
In any case, it will tell you what directories it's going to use, and it will
give you time to cancel the script if they are incorrect.
";
}
sub is_kde3_kmessrc
{
my( $kmessrc ) = @_;
# We check whether the given kmessrc is for KMess 1.5 or 2.0, simply by
# checking if we can find a "[Contact_" in it. KMess 2.0 doesn't have that
# anymore, so if no '[Contact_' is found in the file, we assume it's not
# KMess 1.5. (by the way, this assumes the user ever logged in to KMess and
# had "remember account" enabled - if he didn't, there's no merging anyway)
my $result = 0;
my $handle;
if( !open $handle, $kmessrc )
{
warn "Failed to open KMessRC file $kmessrc: $!";
return 0;
}
while(<$handle>) {
if( /^\[Contact_/ )
{
close $handle;
return 1;
}
}
close $handle;
return 0;
}
sub sleepCounter
{
my ($seconds) = @_;
$| = 1;
if( $seconds <= 0 )
{
print "\r0 \n";
return;
}
print "\r" . $seconds . " ";
sleep 1;
sleepCounter( $seconds - 1 );
}
+2314 -2726
View File
File diff suppressed because it is too large Load Diff
+1020 -988
View File
File diff suppressed because it is too large Load Diff
+1187 -1071
View File
File diff suppressed because it is too large Load Diff
+1421 -2097
View File
File diff suppressed because it is too large Load Diff
+1853 -1615
View File
File diff suppressed because it is too large Load Diff
+1673 -1611
View File
File diff suppressed because it is too large Load Diff
+1163 -1064
View File
File diff suppressed because it is too large Load Diff
+2168 -1876
View File
File diff suppressed because it is too large Load Diff
+1563 -1470
View File
File diff suppressed because it is too large Load Diff
+1623 -1930
View File
File diff suppressed because it is too large Load Diff
+810 -810
View File
File diff suppressed because it is too large Load Diff
+6087
View File
File diff suppressed because it is too large Load Diff
+1236 -1151
View File
File diff suppressed because it is too large Load Diff
+1163 -1064
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -44,7 +44,7 @@ xgettext --from-code=UTF-8 --language=C++ --kde \
-ci18n \
-ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
-kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale \
-kaliasLocale \
--debug \
--msgid-bugs-address="$BUGADDR" \
--exclude-file=kmess.pot.ignore \
+1165 -1064
View File
File diff suppressed because it is too large Load Diff
+921 -895
View File
File diff suppressed because it is too large Load Diff
+894 -857
View File
File diff suppressed because it is too large Load Diff
+2179 -2158
View File
File diff suppressed because it is too large Load Diff
+1172 -1069
View File
File diff suppressed because it is too large Load Diff
+1246 -1121
View File
File diff suppressed because it is too large Load Diff
+1203 -1077
View File
File diff suppressed because it is too large Load Diff
+1169 -1067
View File
File diff suppressed because it is too large Load Diff
+1187 -1072
View File
File diff suppressed because it is too large Load Diff
+1186 -1071
View File
File diff suppressed because it is too large Load Diff
+1414 -1208
View File
File diff suppressed because it is too large Load Diff
+7 -27
View File
@@ -55,37 +55,22 @@ SET(kmess_SOURCES
network/applications/applicationlist.cpp
network/applications/filetransfer.cpp
network/applications/filetransferp2p.cpp
network/applications/gnomemeeting.cpp
network/applications/inktransferp2p.cpp
network/applications/mimeapplication.cpp
network/applications/msnremotedesktop.cpp
network/applications/p2papplicationbase.cpp
network/applications/p2papplication.cpp
network/applications/msnobjecttransferp2p.cpp
network/applications/sipconnection.cpp
network/applications/voiceconversation.cpp
network/applications/webapplicationp2p.cpp
network/applications/webcamtransferp2p.cpp
network/extra/directconnectionbase.cpp
network/extra/directconnectionpool.cpp
network/extra/msndirectconnection.cpp
network/extra/msnftpconnection.cpp
network/extra/msnwebcamconnection.cpp
network/extra/p2pfragmenttracker.cpp
network/soap/addressbookservice.cpp
network/soap/httpsoapconnection.cpp
network/soap/msnappdirectoryservice.cpp
network/soap/offlineimservice.cpp
network/soap/passportloginservice.cpp
network/soap/roamingservice.cpp
network/soap/soapmessage.cpp
network/upnp/igdcontrolpoint.cpp
network/upnp/layer3forwardingservice.cpp
network/upnp/manager.cpp
network/upnp/rootservice.cpp
network/upnp/service.cpp
network/upnp/ssdpconnection.cpp
network/upnp/wanconnectionservice.cpp
notification/chatnotification.cpp
notification/contactstatusnotification.cpp
notification/notificationmanager.cpp
@@ -104,7 +89,6 @@ SET(kmess_SOURCES
utils/idletimer.cpp
utils/kmessconfig.cpp
utils/kmessdbus.cpp
utils/kmessdbusadaptor.cpp
utils/kmessdbusdatatypes.cpp
utils/kmessshared.cpp
utils/nowlisteningclient.cpp
@@ -112,6 +96,7 @@ SET(kmess_SOURCES
utils/thumbnailprovider.cpp
utils/xautolock.cpp
utils/xmlfunctions.cpp
utils/gradientelidelabel.cpp
account.cpp
accountaction.cpp
accountsmanager.cpp
@@ -204,20 +189,20 @@ IF( ${KMESS_ENABLE_DEBUG_OUTPUT} EQUAL 1 )
ENDIF( CMAKE_BUILD_TYPE STREQUAL debugfull )
ENDIF( ${KMESS_ENABLE_DEBUG_OUTPUT} EQUAL 1 )
# Enable BinReloc for Autopackage support. Also requires libpthread
IF( UNIX AND KMESS_ENABLE_BINRELOC EQUAL 1 )
SET(kmess_SOURCES ${kmess_SOURCES} binreloc.c)
SET(kmess_LIBS ${kmess_LIBS} pthread)
ENDIF( UNIX AND KMESS_ENABLE_BINRELOC EQUAL 1 )
# Add XScreensaver library for away-idle detection.
IF( X11_Xscreensaver_FOUND )
SET(kmess_LIBS ${kmess_LIBS} ${X11_Xscreensaver_LIB})
ENDIF( X11_Xscreensaver_FOUND )
# Set our new shiny KDE debug number to be the default
add_definitions( -DKDE_DEFAULT_DEBUG_AREA=5130 )
# Define the app icon for Windows / Mac OS
KDE4_ADD_APP_ICON( kmess_SOURCES ../data/icons/hi*-app-kmess.png )
# Create a DBus adapter from XML file
QT4_ADD_DBUS_ADAPTOR( kmess_SOURCES utils/kmessdbus.xml utils/kmessdbus.h KMessDBus )
# Define all files
KDE4_ADD_UI_FILES( kmess_SOURCES ${kmess_UI_FILES} )
KDE4_ADD_EXECUTABLE( kmess ${kmess_SOURCES} )
@@ -229,8 +214,3 @@ INSTALL( TARGETS kmess DESTINATION ${BIN_INSTALL_DIR})
INSTALL( FILES chat/chatwindowui.rc DESTINATION ${DATA_INSTALL_DIR}/kmess )
INSTALL( FILES kmessinterfaceui.rc DESTINATION ${DATA_INSTALL_DIR}/kmess )
IF( LIBKONQ_FOUND )
ADD_SUBDIRECTORY( utils/kmess-send )
ENDIF( LIBKONQ_FOUND )
+4 -4
View File
@@ -89,8 +89,8 @@ Account::Account()
useEmoticons_(true),
useFontEffects_(true),
useIdleTimer_(true),
useListFormatting_(false),
useChatFormatting_(false),
useListFormatting_(true),
useChatFormatting_(true),
verified_(true),
@@ -796,12 +796,12 @@ void Account::readProperties( const QString &handle )
timestampShowDate_ = profileGroup.readEntry( "timestampShowDate", false );
timestampShowSeconds_ = profileGroup.readEntry( "timestampShowSeconds", false );
useAutologin_ = profileGroup.readEntry( "useAutologin", false );
useChatFormatting_ = profileGroup.readEntry( "useChatFormatting", false );
useChatFormatting_ = profileGroup.readEntry( "useChatFormatting", true );
useContactFont_ = profileGroup.readEntry( "useContactFont", false );
useEmoticons_ = profileGroup.readEntry( "useEmoticons", true );
useFontEffects_ = profileGroup.readEntry( "useFontEffects", true );
useIdleTimer_ = profileGroup.readEntry( "useIdleTimer", true );
useListFormatting_ = profileGroup.readEntry( "useListFormatting", false );
useListFormatting_ = profileGroup.readEntry( "useListFormatting", true );
updateMsnObject();
+11 -11
View File
@@ -461,26 +461,26 @@ void AccountsManager::slotWalletOpen( bool success )
const QString& handle( account->getHandle() );
bool savePassword = ( account->getSavePassword() && ! account->getPassword().isEmpty() );
if( passwordManager_->hasEntry( handle ) )
// If the password should not be saved, then delete any already saved password
if( savePassword == false && passwordManager_->hasEntry( handle ) )
{
// If the password should not be saved, then delete any already saved password
if( savePassword == false )
{
#ifdef KMESSDEBUG_ACCOUNTSMANAGER_KWALLET
kDebug() << "Removing account" << handle << "from wallet";
kDebug() << "Removing account" << handle << "from wallet";
#endif
account->setSavedPassword( "" );
passwordManager_->removeEntry( handle );
continue;
}
account->setSavedPassword( "" );
passwordManager_->removeEntry( handle );
continue;
}
// Store the password only if it wasn't already
else if( savePassword == true && passwordManager_->writePassword( handle, account->getPassword() ) != 0 )
// Update the password if we should
else if( savePassword == true && account->getSavedPassword() != account->getPassword()
&& passwordManager_->writePassword( handle, account->getPassword() ) != 0 )
{
#ifdef KMESSDEBUG_ACCOUNTSMANAGER_KWALLET
kDebug() << "Couldn't store password for account" << handle;
#endif
account->setSavedPassword( "" );
continue;
}
account->setSavedPassword( account->getPassword() );
-768
View File
@@ -1,768 +0,0 @@
/*
* BinReloc - a library for creating relocatable executables
* Written by: Hongli Lai <h.lai@chello.nl>
* http://autopackage.org/
*
* This source code is public domain. You can relicense this code
* under whatever license you want.
*
* See http://autopackage.org/docs/binreloc/ for
* more information and how to use this.
*/
#ifndef __BINRELOC_C__
#define __BINRELOC_C__
#include "config-kmess.h"
#if ( ENABLE_BINRELOC != 0 )
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#endif /* ( ENABLE_BINRELOC != 0 ) */
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <string.h>
#include "binreloc.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** @internal
* Find the canonical filename of the executable. Returns the filename
* (which must be freed) or NULL on error. If the parameter 'error' is
* not NULL, the error code will be stored there, if an error occured.
*/
static char *
_br_find_exe (BrInitError *error)
{
#if ( ENABLE_BINRELOC == 0 )
if (error)
*error = BR_INIT_ERROR_DISABLED;
return NULL;
#else
char *path, *path2, *line, *result;
size_t buf_size;
ssize_t size;
struct stat stat_buf;
FILE *f;
/* Read from /proc/self/exe (symlink) */
if (sizeof (path) > SSIZE_MAX)
buf_size = SSIZE_MAX - 1;
else
buf_size = PATH_MAX - 1;
path = (char *) malloc (buf_size);
if (path == NULL) {
/* Cannot allocate memory. */
if (error)
*error = BR_INIT_ERROR_NOMEM;
return NULL;
}
path2 = (char *) malloc (buf_size);
if (path2 == NULL) {
/* Cannot allocate memory. */
if (error)
*error = BR_INIT_ERROR_NOMEM;
free (path);
return NULL;
}
strncpy (path2, "/proc/self/exe", buf_size - 1);
while (1) {
int i;
size = readlink (path2, path, buf_size - 1);
if (size == -1) {
/* Error. */
free (path2);
break;
}
/* readlink() success. */
path[size] = '\0';
/* Check whether the symlink's target is also a symlink.
* We want to get the final target. */
i = stat (path, &stat_buf);
if (i == -1) {
/* Error. */
free (path2);
break;
}
/* stat() success. */
if (!S_ISLNK (stat_buf.st_mode)) {
/* path is not a symlink. Done. */
free (path2);
return path;
}
/* path is a symlink. Continue loop and resolve this. */
strncpy (path, path2, buf_size - 1);
}
/* readlink() or stat() failed; this can happen when the program is
* running in Valgrind 2.2. Read from /proc/self/maps as fallback. */
buf_size = PATH_MAX + 128;
line = (char *) realloc (path, buf_size);
if (line == NULL) {
/* Cannot allocate memory. */
free (path);
if (error)
*error = BR_INIT_ERROR_NOMEM;
return NULL;
}
f = fopen ("/proc/self/maps", "r");
if (f == NULL) {
free (line);
if (error)
*error = BR_INIT_ERROR_OPEN_MAPS;
return NULL;
}
/* The first entry should be the executable name. */
result = fgets (line, (int) buf_size, f);
if (result == NULL) {
fclose (f);
free (line);
if (error)
*error = BR_INIT_ERROR_READ_MAPS;
return NULL;
}
/* Get rid of newline character. */
buf_size = strlen (line);
if (buf_size <= 0) {
/* Huh? An empty string? */
fclose (f);
free (line);
if (error)
*error = BR_INIT_ERROR_INVALID_MAPS;
return NULL;
}
if (line[buf_size - 1] == 10)
line[buf_size - 1] = 0;
/* Extract the filename; it is always an absolute path. */
path = strchr (line, '/');
/* Sanity check. */
if (strstr (line, " r-xp ") == NULL || path == NULL) {
fclose (f);
free (line);
if (error)
*error = BR_INIT_ERROR_INVALID_MAPS;
return NULL;
}
path = strdup (path);
free (line);
fclose (f);
return path;
#endif /* ENABLE_BINRELOC */
}
/** @internal
* Find the canonical filename of the executable which owns symbol.
* Returns a filename which must be freed, or NULL on error.
*/
static char *
_br_find_exe_for_symbol (const void *symbol, BrInitError *error)
{
*error = BR_INIT_ERROR_DISABLED; /* Avoid a compiler warning */
#if ( ENABLE_BINRELOC == 0 )
return (char *) NULL;
#else
#define SIZE PATH_MAX + 100
FILE *f;
size_t address_string_len;
char *address_string, line[SIZE], *found;
if (symbol == NULL)
return (char *) NULL;
f = fopen ("/proc/self/maps", "r");
if (f == NULL)
return (char *) NULL;
address_string_len = 4;
address_string = (char *) malloc (address_string_len);
found = (char *) NULL;
while (!feof (f)) {
char *start_addr, *end_addr, *end_addr_end, *file;
void *start_addr_p, *end_addr_p;
size_t len;
if (fgets (line, SIZE, f) == NULL)
break;
/* Sanity check. */
if (strstr (line, " r-xp ") == NULL || strchr (line, '/') == NULL)
continue;
/* Parse line. */
start_addr = line;
end_addr = strchr (line, '-');
file = strchr (line, '/');
/* More sanity check. */
if (!(file > end_addr && end_addr != NULL && end_addr[0] == '-'))
continue;
end_addr[0] = '\0';
end_addr++;
end_addr_end = strchr (end_addr, ' ');
if (end_addr_end == NULL)
continue;
end_addr_end[0] = '\0';
len = strlen (file);
if (len == 0)
continue;
if (file[len - 1] == '\n')
file[len - 1] = '\0';
/* Get rid of "(deleted)" from the filename. */
len = strlen (file);
if (len > 10 && strcmp (file + len - 10, " (deleted)") == 0)
file[len - 10] = '\0';
/* I don't know whether this can happen but better safe than sorry. */
len = strlen (start_addr);
if (len != strlen (end_addr))
continue;
/* Transform the addresses into a string in the form of 0xdeadbeef,
* then transform that into a pointer. */
if (address_string_len < len + 3) {
address_string_len = len + 3;
address_string = (char *) realloc (address_string, address_string_len);
}
memcpy (address_string, "0x", 2);
memcpy (address_string + 2, start_addr, len);
address_string[2 + len] = '\0';
sscanf (address_string, "%p", &start_addr_p);
memcpy (address_string, "0x", 2);
memcpy (address_string + 2, end_addr, len);
address_string[2 + len] = '\0';
sscanf (address_string, "%p", &end_addr_p);
if (symbol >= start_addr_p && symbol < end_addr_p) {
found = file;
break;
}
}
free (address_string);
fclose (f);
if (found == NULL)
return (char *) NULL;
else
return strdup (found);
#endif /* ENABLE_BINRELOC */
}
#ifndef BINRELOC_RUNNING_DOXYGEN
#undef NULL
#define NULL ((void *) 0) /* typecasted as char* for C++ type safeness */
#endif
static char *exe = (char *) NULL;
/** Initialize the BinReloc library (for applications).
*
* This function must be called before using any other BinReloc functions.
* It attempts to locate the application's canonical filename.
*
* @note If you want to use BinReloc for a library, then you should call
* br_init_lib() instead.
*
* @param error If BinReloc failed to initialize, then the error code will
* be stored in this variable. Set to NULL if you want to
* ignore this. See #BrInitError for a list of error codes.
*
* @returns 1 on success, 0 if BinReloc failed to initialize.
*/
int
br_init (BrInitError *error)
{
exe = _br_find_exe (error);
return exe != NULL;
}
/** Initialize the BinReloc library (for libraries).
*
* This function must be called before using any other BinReloc functions.
* It attempts to locate the calling library's canonical filename.
*
* @note The BinReloc source code MUST be included in your library, or this
* function won't work correctly.
*
* @param error If BinReloc failed to initialize, then the error code will
* be stored in this variable. Set to NULL if you want to
* ignore this. See #BrInitError for a list of error codes.
*
* @returns 1 on success, 0 if a filename cannot be found.
*/
int
br_init_lib (BrInitError *error)
{
exe = _br_find_exe_for_symbol ((const void *) "", error);
return exe != NULL;
}
/** Find the canonical filename of the current application.
*
* @param default_exe A default filename which will be used as fallback.
* @returns A string containing the application's canonical filename,
* which must be freed when no longer necessary. If BinReloc is
* not initialized, or if br_init() failed, then a copy of
* default_exe will be returned. If default_exe is NULL, then
* NULL will be returned.
*/
char *
br_find_exe (const char *default_exe)
{
if (exe == (char *) NULL) {
/* BinReloc is not initialized. */
if (default_exe != (const char *) NULL)
return strdup (default_exe);
else
return (char *) NULL;
}
return strdup (exe);
}
/** Locate the directory in which the current application is installed.
*
* The prefix is generated by the following pseudo-code evaluation:
* \code
* dirname(exename)
* \endcode
*
* @param default_dir A default directory which will used as fallback.
* @return A string containing the directory, which must be freed when no
* longer necessary. If BinReloc is not initialized, or if the
* initialization function failed, then a copy of default_dir
* will be returned. If default_dir is NULL, then NULL will be
* returned.
*/
char *
br_find_exe_dir (const char *default_dir)
{
if (exe == NULL) {
/* BinReloc not initialized. */
if (default_dir != NULL)
return strdup (default_dir);
else
return NULL;
}
return br_dirname (exe);
}
/** Locate the prefix in which the current application is installed.
*
* The prefix is generated by the following pseudo-code evaluation:
* \code
* dirname(dirname(exename))
* \endcode
*
* @param default_prefix A default prefix which will used as fallback.
* @return A string containing the prefix, which must be freed when no
* longer necessary. If BinReloc is not initialized, or if
* the initialization function failed, then a copy of default_prefix
* will be returned. If default_prefix is NULL, then NULL will be returned.
*/
char *
br_find_prefix (const char *default_prefix)
{
char *dir1, *dir2;
if (exe == (char *) NULL) {
/* BinReloc not initialized. */
if (default_prefix != (const char *) NULL)
return strdup (default_prefix);
else
return (char *) NULL;
}
dir1 = br_dirname (exe);
dir2 = br_dirname (dir1);
free (dir1);
return dir2;
}
/** Locate the application's binary folder.
*
* The path is generated by the following pseudo-code evaluation:
* \code
* prefix + "/bin"
* \endcode
*
* @param default_bin_dir A default path which will used as fallback.
* @return A string containing the bin folder's path, which must be freed when
* no longer necessary. If BinReloc is not initialized, or if
* the initialization function failed, then a copy of default_bin_dir will
* be returned. If default_bin_dir is NULL, then NULL will be returned.
*/
char *
br_find_bin_dir (const char *default_bin_dir)
{
char *prefix, *dir;
prefix = br_find_prefix ((const char *) NULL);
if (prefix == (char *) NULL) {
/* BinReloc not initialized. */
if (default_bin_dir != (const char *) NULL)
return strdup (default_bin_dir);
else
return (char *) NULL;
}
dir = br_build_path (prefix, "bin");
free (prefix);
return dir;
}
/** Locate the application's superuser binary folder.
*
* The path is generated by the following pseudo-code evaluation:
* \code
* prefix + "/sbin"
* \endcode
*
* @param default_sbin_dir A default path which will used as fallback.
* @return A string containing the sbin folder's path, which must be freed when
* no longer necessary. If BinReloc is not initialized, or if the
* initialization function failed, then a copy of default_sbin_dir will
* be returned. If default_bin_dir is NULL, then NULL will be returned.
*/
char *
br_find_sbin_dir (const char *default_sbin_dir)
{
char *prefix, *dir;
prefix = br_find_prefix ((const char *) NULL);
if (prefix == (char *) NULL) {
/* BinReloc not initialized. */
if (default_sbin_dir != (const char *) NULL)
return strdup (default_sbin_dir);
else
return (char *) NULL;
}
dir = br_build_path (prefix, "sbin");
free (prefix);
return dir;
}
/** Locate the application's data folder.
*
* The path is generated by the following pseudo-code evaluation:
* \code
* prefix + "/share"
* \endcode
*
* @param default_data_dir A default path which will used as fallback.
* @return A string containing the data folder's path, which must be freed when
* no longer necessary. If BinReloc is not initialized, or if the
* initialization function failed, then a copy of default_data_dir
* will be returned. If default_data_dir is NULL, then NULL will be
* returned.
*/
char *
br_find_data_dir (const char *default_data_dir)
{
char *prefix, *dir;
prefix = br_find_prefix ((const char *) NULL);
if (prefix == (char *) NULL) {
/* BinReloc not initialized. */
if (default_data_dir != (const char *) NULL)
return strdup (default_data_dir);
else
return (char *) NULL;
}
dir = br_build_path (prefix, "share");
free (prefix);
return dir;
}
/** Locate the application's localization folder.
*
* The path is generated by the following pseudo-code evaluation:
* \code
* prefix + "/share/locale"
* \endcode
*
* @param default_locale_dir A default path which will used as fallback.
* @return A string containing the localization folder's path, which must be freed when
* no longer necessary. If BinReloc is not initialized, or if the
* initialization function failed, then a copy of default_locale_dir will be returned.
* If default_locale_dir is NULL, then NULL will be returned.
*/
char *
br_find_locale_dir (const char *default_locale_dir)
{
char *data_dir, *dir;
data_dir = br_find_data_dir ((const char *) NULL);
if (data_dir == (char *) NULL) {
/* BinReloc not initialized. */
if (default_locale_dir != (const char *) NULL)
return strdup (default_locale_dir);
else
return (char *) NULL;
}
dir = br_build_path (data_dir, "locale");
free (data_dir);
return dir;
}
/** Locate the application's library folder.
*
* The path is generated by the following pseudo-code evaluation:
* \code
* prefix + "/lib"
* \endcode
*
* @param default_lib_dir A default path which will used as fallback.
* @return A string containing the library folder's path, which must be freed when
* no longer necessary. If BinReloc is not initialized, or if the initialization
* function failed, then a copy of default_lib_dir will be returned.
* If default_lib_dir is NULL, then NULL will be returned.
*/
char *
br_find_lib_dir (const char *default_lib_dir)
{
char *prefix, *dir;
prefix = br_find_prefix ((const char *) NULL);
if (prefix == (char *) NULL) {
/* BinReloc not initialized. */
if (default_lib_dir != (const char *) NULL)
return strdup (default_lib_dir);
else
return (char *) NULL;
}
dir = br_build_path (prefix, "lib");
free (prefix);
return dir;
}
/** Locate the application's libexec folder.
*
* The path is generated by the following pseudo-code evaluation:
* \code
* prefix + "/libexec"
* \endcode
*
* @param default_libexec_dir A default path which will used as fallback.
* @return A string containing the libexec folder's path, which must be freed when
* no longer necessary. If BinReloc is not initialized, or if the initialization
* function failed, then a copy of default_libexec_dir will be returned.
* If default_libexec_dir is NULL, then NULL will be returned.
*/
char *
br_find_libexec_dir (const char *default_libexec_dir)
{
char *prefix, *dir;
prefix = br_find_prefix ((const char *) NULL);
if (prefix == (char *) NULL) {
/* BinReloc not initialized. */
if (default_libexec_dir != (const char *) NULL)
return strdup (default_libexec_dir);
else
return (char *) NULL;
}
dir = br_build_path (prefix, "libexec");
free (prefix);
return dir;
}
/** Locate the application's configuration files folder.
*
* The path is generated by the following pseudo-code evaluation:
* \code
* prefix + "/etc"
* \endcode
*
* @param default_etc_dir A default path which will used as fallback.
* @return A string containing the etc folder's path, which must be freed when
* no longer necessary. If BinReloc is not initialized, or if the initialization
* function failed, then a copy of default_etc_dir will be returned.
* If default_etc_dir is NULL, then NULL will be returned.
*/
char *
br_find_etc_dir (const char *default_etc_dir)
{
char *prefix, *dir;
prefix = br_find_prefix ((const char *) NULL);
if (prefix == (char *) NULL) {
/* BinReloc not initialized. */
if (default_etc_dir != (const char *) NULL)
return strdup (default_etc_dir);
else
return (char *) NULL;
}
dir = br_build_path (prefix, "etc");
free (prefix);
return dir;
}
/***********************
* Utility functions
***********************/
/** Concatenate str1 and str2 to a newly allocated string.
*
* @param str1 A string.
* @param str2 Another string.
* @returns A newly-allocated string. This string should be freed when no longer needed.
*/
char *
br_strcat (const char *str1, const char *str2)
{
char *result;
size_t len1, len2;
if (str1 == NULL)
str1 = "";
if (str2 == NULL)
str2 = "";
len1 = strlen (str1);
len2 = strlen (str2);
result = (char *) malloc (len1 + len2 + 1);
memcpy (result, str1, len1);
memcpy (result + len1, str2, len2);
result[len1 + len2] = '\0';
return result;
}
char *
br_build_path (const char *dir, const char *file)
{
char *dir2, *result;
size_t len;
int must_free = 0;
len = strlen (dir);
if (len > 0 && dir[len - 1] != '/') {
dir2 = br_strcat (dir, "/");
must_free = 1;
} else
dir2 = (char *) dir;
result = br_strcat (dir2, file);
if (must_free)
free (dir2);
return result;
}
/* Emulates glibc's strndup() */
static char *
br_strndup (const char *str, size_t size)
{
char *result = (char *) NULL;
size_t len;
if (str == (const char *) NULL)
return (char *) NULL;
len = strlen (str);
if (len == 0)
return strdup ("");
if (size > len)
size = len;
result = (char *) malloc (len + 1);
memcpy (result, str, size);
result[size] = '\0';
return result;
}
/** Extracts the directory component of a path.
*
* Similar to g_dirname() or the dirname commandline application.
*
* Example:
* \code
* br_dirname ("/usr/local/foobar"); --> Returns: "/usr/local"
* \endcode
*
* @param path A path.
* @returns A directory name. This string should be freed when no longer needed.
*/
char *
br_dirname (const char *path)
{
char *end, *result;
if (path == (const char *) NULL)
return (char *) NULL;
end = strrchr (path, '/');
if (end == (const char *) NULL)
return strdup (".");
while (end > path && *end == '/')
end--;
result = br_strndup (path, end - path + 1);
if (result[0] == 0) {
free (result);
return strdup ("/");
} else
return result;
}
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __BINRELOC_C__ */
-80
View File
@@ -1,80 +0,0 @@
/*
* BinReloc - a library for creating relocatable executables
* Written by: Hongli Lai <h.lai@chello.nl>
* http://autopackage.org/
*
* This source code is public domain. You can relicense this code
* under whatever license you want.
*
* See http://autopackage.org/docs/binreloc/ for
* more information and how to use this.
*/
#ifndef __BINRELOC_H__
#define __BINRELOC_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** These error codes can be returned by br_init(), br_init_lib(), gbr_init() or gbr_init_lib(). */
typedef enum {
/** Cannot allocate memory. */
BR_INIT_ERROR_NOMEM,
/** Unable to open /proc/self/maps; see errno for details. */
BR_INIT_ERROR_OPEN_MAPS,
/** Unable to read from /proc/self/maps; see errno for details. */
BR_INIT_ERROR_READ_MAPS,
/** The file format of /proc/self/maps is invalid; kernel bug? */
BR_INIT_ERROR_INVALID_MAPS,
/** BinReloc is disabled (the ENABLE_BINRELOC macro is not defined). */
BR_INIT_ERROR_DISABLED
} BrInitError;
#ifndef BINRELOC_RUNNING_DOXYGEN
/* Mangle symbol names to avoid symbol collisions with other ELF objects. */
#define br_init NdrX88470773085743_br_init
#define br_init_lib NdrX88470773085743_br_init_lib
#define br_find_exe NdrX88470773085743_br_find_exe
#define br_find_exe_dir NdrX88470773085743_br_find_exe_dir
#define br_find_prefix NdrX88470773085743_br_find_prefix
#define br_find_bin_dir NdrX88470773085743_br_find_bin_dir
#define br_find_sbin_dir NdrX88470773085743_br_find_sbin_dir
#define br_find_data_dir NdrX88470773085743_br_find_data_dir
#define br_find_locale_dir NdrX88470773085743_br_find_locale_dir
#define br_find_lib_dir NdrX88470773085743_br_find_lib_dir
#define br_find_libexec_dir NdrX88470773085743_br_find_libexec_dir
#define br_find_etc_dir NdrX88470773085743_br_find_etc_dir
#define br_strcat NdrX88470773085743_br_strcat
#define br_build_path NdrX88470773085743_br_build_path
#define br_dirname NdrX88470773085743_br_dirname
#endif
int br_init (BrInitError *error);
int br_init_lib (BrInitError *error);
char *br_find_exe (const char *default_exe);
char *br_find_exe_dir (const char *default_dir);
char *br_find_prefix (const char *default_prefix);
char *br_find_bin_dir (const char *default_bin_dir);
char *br_find_sbin_dir (const char *default_sbin_dir);
char *br_find_data_dir (const char *default_data_dir);
char *br_find_locale_dir (const char *default_locale_dir);
char *br_find_lib_dir (const char *default_lib_dir);
char *br_find_libexec_dir (const char *default_libexec_dir);
char *br_find_etc_dir (const char *default_etc_dir);
/* Utility functions */
char *br_strcat (const char *str1, const char *str2);
char *br_build_path (const char *dir, const char *file);
char *br_dirname (const char *path);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __BINRELOC_H__ */
+37 -69
View File
@@ -839,23 +839,29 @@ void Chat::saveChatAutomatically( bool saveExternalFile )
QString fileCount;
QString savePath( dir.absolutePath() + "/" );
bool nextFileExists = KMessShared::selectNextFile( savePath, fileName, fileCount, extension, fileNumber );
// We need to get the current (last) logging file; if it's not too big we'll append
// to it; if it is too big or there is no current/last logging file, we'll create a new one.
bool lastFileExists = KMessShared::selectNextFile( savePath, fileName, fileCount, extension, fileNumber );
// this is the last file as pointed to by selectNextFile; lastFileExists should be the same as file.exists()
QFile file( savePath + fileName + fileCount + "." + extension );
// There are log files already for this contact: verify if we can
// append to the last one: logs should not be too big
if( nextFileExists && file.size() > 2000000L )
// append to the last one: logs should not be too big (2MB max)
if( lastFileExists && file.size() > Chat::MAX_LOG_FILE_SIZE )
{
#ifdef KMESSDEBUG_CHAT_GENERAL
kDebug() << "Last file" << file.fileName() << "is too big, choosing next one";
kDebug() << "Last file" << file.fileName() << "is too big, creating a new file";
#endif
// Find the first file after the one we can't append to
KMessShared::selectNextFile( savePath, fileName, fileCount, extension, fileNumber );
// so automatically choose the next file name.
file.setFileName( savePath + fileName + "." + QString::number( fileNumber ) + "." + extension );
}
// if lastFileExists == false. then the base file is available for writing.
// use it.
#ifdef KMESSDEBUG_CHAT_GENERAL
kDebug() << "Chat file:" << file.fileName();
kDebug() << "Saving to chat log file:" << file.fileName();
#endif
// Save the chat in the format requested by the user
@@ -863,17 +869,33 @@ void Chat::saveChatAutomatically( bool saveExternalFile )
false, /* Don't overwrite */
false /* No user interaction */ ) )
{
#ifdef KMESSDEBUG_CHAT_GENERAL
kDebug() << "Save failed. Trying next file name";
#endif
// If saving fails (due to a corrupted file for example) just save the chat
// If saving fails (due to a corrupted file for example) try to save the chat
// with the next available file name
KMessShared::selectNextFile( savePath, fileName, fileCount, extension, fileNumber );
file.setFileName( savePath + fileName + "." + QString::number( fileNumber ) + "." + extension );
// Possible race condition but we'll take it: since we can assume the
// returned file above was indeed the last file, the next file must be
// nonexistant, so we use that as a new file now
// This time warn the user if saving fails again
saveChatToFile( file.fileName(), format, true, true );
// Another thing is that if we were *already* creating a new file and the
// save failed, we will try to save to the same file yet again. However,
// when saving to a new file already fails, whatever we do it probably
// won't work with a different filename either.
// TODO: make this more robust.
file.setFileName( savePath + fileName + "." + QString::number( fileNumber ) + "." + extension );
kWarning() << "Save failed. Trying next file name=" << file.fileName();
// Try to save it again, this time warning the user if it fails once more
if( ! saveChatToFile( file.fileName(), format, false, true ) )
{
kWarning() << "Second save failed too.";
}
#ifdef KMESSDEBUG_CHAT_GENERAL
else
{
kDebug() << "Second save attempt succeeded.";
}
#endif
}
if( saveExternalFile == false && currentAccount_->getSaveChatsToFile() )
@@ -1702,58 +1724,4 @@ void Chat::startChat()
//Start voice conversation
void Chat::startConversation()
{
if( KMESS_NULL(msnSwitchboardConnection_) )
{
#ifdef KMESSDEBUG_CHAT_GENERAL
kWarning() << "Tried to open a conversation without a switchboard!";
#endif
return;
}
kWarning() << "not implemented!";
// msnSwitchboardConnection_->startApp( MsnSwitchboardConnection::VOICECONVERSATION );
}
// Start GnomeMeeting with a contact.
void Chat::startMeeting()
{
// Choose the contact.
const QString& handle( chooseContact() );
if( KMESS_NULL(msnSwitchboardConnection_) )
{
#ifdef KMESSDEBUG_CHAT_GENERAL
kWarning() << "Tried to open a meeting with \'" << handle << "\' without a switchboard!";
#endif
return;
}
emit requestNetMeeting(handle);
}
// Send webcam data to a contact.
void Chat::startWebcamTransfer()
{
// Choose the contact.
const QString& handle( chooseContact() );
if( KMESS_NULL(msnSwitchboardConnection_) )
{
#ifdef KMESSDEBUG_CHAT_GENERAL
kWarning() << "Tried to open a meeting with \'" << handle << "\' without a switchboard!";
#endif
return;
}
emit requestWebcamTransfer(handle);
}
#include "chat.moc"
+3 -10
View File
@@ -124,12 +124,6 @@ class Chat : public ChatView
void slotSendNudge();
// Send a file to a contact.
void startFileTransfer( QList<QUrl> fileList = QList<QUrl>() );
//Voice conversation
void startConversation();
// Start GnomeMeeting with a contact.
void startMeeting();
// Send webcam data to a contact.
void startWebcamTransfer();
private: // Private methods
// Choose the contact to start an invitation with.
@@ -178,6 +172,9 @@ class Chat : public ChatView
// Handle a command from ChatView (e.g. '/online')
bool handleCommand( QString command );
public:
// maximum log file size, 2MB.
static const long MAX_LOG_FILE_SIZE = 2*1024*1024;
signals:
// Signal that some chat details (like the number of active contacts) have changed
@@ -192,10 +189,6 @@ class Chat : public ChatView
void gotNudge();
// Signal that the ChatMaster should start a filetransfer.
void requestFileTransfer(const QString &handle, const QString &filename);
// Signal that the ChatMaster should start a newmeeting session.
void requestNetMeeting(const QString &handle);
// Signal that the ChatMaster should start a webcam transfer.
void requestWebcamTransfer(const QString &handle);
// The user wants to add or remove a contact.
void contactAdded( QString handle, bool isAdded );
// The user wants to allow a contact to see his/hers online status.
+1 -49
View File
@@ -26,10 +26,8 @@
#include "../network/applications/p2papplication.h"
#include "../network/applications/filetransfer.h"
#include "../network/applications/filetransferp2p.h"
#include "../network/applications/gnomemeeting.h"
#include "../network/applications/inktransferp2p.h"
#include "../network/applications/msnobjecttransferp2p.h"
#include "../network/applications/webcamtransferp2p.h"
#include "../network/chatmessage.h"
#include "../network/msnswitchboardconnection.h"
#include "../currentaccount.h"
@@ -768,7 +766,7 @@ void ChatMaster::raiseChat( Chat *chat, bool force )
// Bypass focus stealing prevention (code from Quassel)
QX11Info::setAppUserTime( QX11Info::appTime() );
#endif
// Workaround a bug in KWin: force the window to get focus
if( chatWindow->windowState() & Qt::WindowMinimized) {
chatWindow->setWindowState( (chatWindow->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive );
@@ -1014,9 +1012,6 @@ void ChatMaster::showMsnObject( const QString &handle, const MsnObject &msnObjec
case MsnObject::BACKGROUND:
// handle background transfers
case MsnObject::VOICECLIP:
// handle voicelip transfers
default:
kWarning() << "Unable to handle MsnObject pictures of type '" << msnObject.getType() << "'.";
}
@@ -1704,10 +1699,6 @@ Chat *ChatMaster::createChat( MsnSwitchboardConnection *switchboard, bool reques
this, SLOT ( slotDeliverAppCommand(QString,QString,QString) ) );
connect( newChat, SIGNAL( requestFileTransfer(const QString&,const QString&) ),
this, SLOT ( startFileTransfer(const QString&,const QString&) ) );
connect( newChat, SIGNAL( requestNetMeeting(const QString&) ),
this, SLOT ( startNetMeeting(const QString&) ) );
connect( newChat, SIGNAL( requestWebcamTransfer(const QString&) ),
this, SLOT ( startWebcamTransfer(const QString&) ) );
connect( newChat, SIGNAL( closing(Chat*) ),
this, SLOT ( slotChatClosing(Chat*) ) );
connect( newChat, SIGNAL( destroyed(QObject*) ),
@@ -1888,24 +1879,6 @@ void ChatMaster::startChatAndFileTransfer( const QString &handle, const QString
// Start a netmeeting invitation
void ChatMaster::startNetMeeting(const QString &handle)
{
// Get the application list
ApplicationList *appList = getApplicationList(handle);
if(KMESS_NULL(appList)) return;
// Get the contact
const ContactBase *contact = currentAccount_->getContactByHandle( handle );
if(KMESS_NULL(contact)) return;
// Create the application
MimeApplication *app = new GnomeMeeting(handle);
startApplication(app);
}
// Start a msnobject transfer to get the contact's msn object.
void ChatMaster::startMsnObjectDownload( const QString &handle, const MsnObject *msnObject, Chat *chat )
{
@@ -1974,27 +1947,6 @@ void ChatMaster::startMsnObjectDownload( const QString &handle, const MsnObject
// Start a webcam transfer with the contact
void ChatMaster::startWebcamTransfer( const QString &handle )
{
ApplicationList *appList = getApplicationList(handle);
if(KMESS_NULL(appList)) return;
// Get the contact properties, see how we can transfer the file.
const ContactBase *contact = currentAccount_->getContactByHandle( handle );
if( contact == 0 || ! contact->hasP2PSupport() )
{
kWarning() << "Contact" << handle << "does not support P2P transfers, using old MIME invitations instead.";
return;
}
// The contact supports file transfer over MSNP2P
P2PApplication *app = new WebcamTransferP2P(appList);
startApplication(app);
}
/**
* Periodically called method for update commands.
*
-4
View File
@@ -128,10 +128,6 @@ class ChatMaster : public QObject
void slotSwitchboardDelete( MsnSwitchboardConnection *closing, bool deleteObject = false );
// The switchboard is ready to send more messages.
void slotSwitchboardReady();
// Start a netmeeting invitation
void startNetMeeting(const QString &handle);
// Start a webcam transfer with the contact
void startWebcamTransfer( const QString &handle );
// Update the grouping of chats/tabs.
void updateChatGrouping();
// Search the appropriate window for a chat.
+34 -12
View File
@@ -58,6 +58,7 @@ ChatMessageStyle::ChatMessageStyle()
, useEmoticons_(true)
, useFontEffects_(true)
, useFormatting_(false)
, allowEmoticonLinks_(true)
{
xslTransformation_ = new XslTransformation();
}
@@ -337,7 +338,7 @@ QString ChatMessageStyle::createFallbackMessage(const ChatMessage &message)
parseFont(message, font, color, fontBefore, fontAfter);
// Escape HTML, replace standard emoticons, links and formatting
RichTextParser::parseMsnString( name, useEmoticons_, true, false, useFormatting_ );
RichTextParser::parseMsnString( name, useEmoticons_, true, false, useFormatting_, allowEmoticonLinks_ );
// Replace font special effects, like *bold*
if( useFontEffects_ )
@@ -349,7 +350,7 @@ QString ChatMessageStyle::createFallbackMessage(const ChatMessage &message)
if( ! message.hasHtmlBody() )
{
// Escape HTML, replace all emoticons, links and formatting
RichTextParser::parseMsnString( body, useEmoticons_, false, true, useFormatting_, handle, pendingEmoticonTags_ );
RichTextParser::parseMsnString( body, useEmoticons_, false, true, useFormatting_, allowEmoticonLinks_, handle, pendingEmoticonTags_ );
// Replace font special effects, like *bold*
if( useFontEffects_ )
@@ -392,8 +393,8 @@ QString ChatMessageStyle::createFallbackMessage(const ChatMessage &message)
"<font color='red'>" + body + "</font>"
"<hr size='2' color='red'></div>";
}
else if( type == ChatMessage::TYPE_APPLICATION || type == ChatMessage::TYPE_APPLICATION_WEBCAM
|| type == ChatMessage::TYPE_APPLICATION_FILE || type == ChatMessage::TYPE_APPLICATION_AUDIO )
else if( type == ChatMessage::TYPE_APPLICATION
|| type == ChatMessage::TYPE_APPLICATION_FILE )
{
// Blue application message
parseBody( KMessShared::htmlEscape( body ) );
@@ -426,7 +427,7 @@ QString ChatMessageStyle::convertMessageToXml( const ChatMessage &message, bool
QString typeString;
QString color;
QFont font;
// Remove any characters which are not allowed in XML
const ushort* utf16 = message.getBody().utf16();
ushort* newutf16 = new ushort[ message.getBody().size() ];
@@ -460,13 +461,15 @@ QString ChatMessageStyle::convertMessageToXml( const ChatMessage &message, bool
// Prepare the strings for HTML
// App messages are not parsed, they may contain HTML (links to click on, etc..)
if( message.isNormalMessage() )
// Only exception to this is presence messages to maintain consistency.
bool isPresence = message.getType() == ChatMessage::TYPE_PRESENCE;
if( message.isNormalMessage() || isPresence )
{
// Extract fonts
parseFont(message, font, color, fontBefore, fontAfter);
// Escape HTML, replace standard emoticons, links and formatting
RichTextParser::parseMsnString( name, useEmoticons_, true, false, useFormatting_ );
RichTextParser::parseMsnString( name, useEmoticons_, true, false, useFormatting_, allowEmoticonLinks_ );
// Parse effects characters (_, *, /)
if( useFontEffects_ )
@@ -478,7 +481,12 @@ QString ChatMessageStyle::convertMessageToXml( const ChatMessage &message, bool
if( ! message.hasHtmlBody() )
{
// Escape HTML, replace all emoticons, links and formatting
RichTextParser::parseMsnString( body, useEmoticons_, false, true, useFormatting_, handle, pendingEmoticonTags_ );
// if this is a presence message, show emoticons only. Otherwise, show the works depending on configuration.
RichTextParser::parseMsnString( body, useEmoticons_, false,
!isPresence,
(isPresence ? false : useFormatting_),
(isPresence ? false : allowEmoticonLinks_),
(isPresence ? QString() : handle), pendingEmoticonTags_ );
if( useFontEffects_ )
{
@@ -487,7 +495,6 @@ QString ChatMessageStyle::convertMessageToXml( const ChatMessage &message, bool
}
}
// Replace newlines with <br/> tags
parseBody(body);
@@ -508,8 +515,6 @@ QString ChatMessageStyle::convertMessageToXml( const ChatMessage &message, bool
case ChatMessage::TYPE_OUTGOING: typeString = "outgoing"; break;
case ChatMessage::TYPE_SYSTEM: typeString = "system"; break;
case ChatMessage::TYPE_APPLICATION_FILE:
case ChatMessage::TYPE_APPLICATION_WEBCAM:
case ChatMessage::TYPE_APPLICATION_AUDIO:
case ChatMessage::TYPE_APPLICATION: typeString = "application"; break;
case ChatMessage::TYPE_OFFLINE_INCOMING: typeString = "offlineIncoming"; break;
case ChatMessage::TYPE_PRESENCE: typeString = "presence"; break;
@@ -673,6 +678,14 @@ const QString & ChatMessageStyle::getName() const
// Return whether or not emoticon links are allowed
bool ChatMessageStyle::getAllowEmoticonLinks() const
{
return allowEmoticonLinks_;
}
// Return if the date is displayed in messages
bool ChatMessageStyle::getShowMessageDate() const
{
@@ -849,7 +862,7 @@ void ChatMessageStyle::parseEffects(QString &text) const
else if( effectHtml[i] == 'u' )
{
// Same for underline
replacement = "_<u>" + effectsSearch.cap(1) + "</u>_";
replacement = "<u>&nbsp;" + effectsSearch.cap(1) + "&nbsp;</u>";
}
// Replace and change offset
@@ -933,6 +946,15 @@ void ChatMessageStyle::setGroupFollowupMessages( bool groupFollowupMessages )
}
// Set whether or not emoticon links are allowed
void ChatMessageStyle::setAllowEmoticonLinks( bool allowEmoticonLinks )
{
allowEmoticonLinks_ = allowEmoticonLinks;
}
// Set the show time state
void ChatMessageStyle::setShowTime(bool showTime)
{
+6
View File
@@ -92,6 +92,8 @@ class ChatMessageStyle : public QObject
bool getUseFontEffects() const;
// Return whether or not the formatting is visible
bool getUseFormatting() const;
// Return whether or not emoticon links may be inserted
bool getAllowEmoticonLinks() const;
// Return whether an style is loaded.
bool hasStyle() const;
@@ -120,6 +122,8 @@ class ChatMessageStyle : public QObject
void setUseFontEffects(bool useFontEffects);
// Enable or disable MSN Plus formatting
void setUseFormatting( bool useFormatting );
// Enable or disable adding emoticon links
void setAllowEmoticonLinks( bool allowEmoticonLinks );
private: // private methods
@@ -169,6 +173,8 @@ class ChatMessageStyle : public QObject
bool useFontEffects_;
// Whether MSN Plus formatting should be used
bool useFormatting_;
// If false, will instruct the rich text parser to never allow emoticon links
bool allowEmoticonLinks_;
// The XSL transformation
XslTransformation *xslTransformation_;
};
+90 -2
View File
@@ -26,6 +26,7 @@
#include <QStringList>
#include <QTimer>
#include <QClipboard>
#include <kdeversion.h>
#include <DOM/DOMString>
@@ -34,6 +35,10 @@
#include <DOM/HTMLElement>
#include <KHTMLView>
#include <KApplication>
#include <KAction>
#include <KStandardAction>
#include <KMenu>
// The constructor
ChatMessageView::ChatMessageView( QWidget *parent )
@@ -73,6 +78,9 @@ ChatMessageView::ChatMessageView( QWidget *parent )
// Initialize the current account
currentAccount_ = CurrentAccount::instance();
// create context menu actions
createPopupMenuActions();
// Everything has been initialized: now load a standard empty HTML page
clearView();
}
@@ -214,12 +222,22 @@ void ChatMessageView::clearView( bool clearHistory )
// Return the HTML source of the page.
QString ChatMessageView::getHistory( Account::ChatExportFormat format, bool &append, QString &appendPoint )
QString ChatMessageView::getHistory( Account::ChatExportFormat format, bool append, QString &appendPoint )
{
QString chatHistory;
QString handle( chatMessages_.first()->getContactHandle() );
uint date ( chatMessages_.first()->getDateTime().toTime_t() );
bool oldAllowEmoticonLinks = chatStyle_->getAllowEmoticonLinks();
chatStyle_->setAllowEmoticonLinks( false );
// There are things which happen inside a chat, but which we don't want in our logs - for example,
// we want links to add new emoticons in our chats, but these make no sense in our logs.
// TODO: fix the situation below:
// - Save the XML data for each chat while it is running in the background
// - Make sure the saved XML data does not include these emoticon links, while the displayed
// text does include them (hint: chatStyle_->setAllowEmoticonLinks() )
switch( format )
{
case Account::EXPORT_XML:
@@ -298,6 +316,11 @@ QString ChatMessageView::getHistory( Account::ChatExportFormat format, bool &app
chatHistory = "\n<conversation timestamp=\"" + QString::number( date ) + "\">\n" + chatHistory + "</conversation>\n";
// we've changed it at line 2 of this method.
// we MUST change it back here otherwise the style tag written
// below could be incorrect!
chatStyle_->setAllowEmoticonLinks( oldAllowEmoticonLinks );
if( append )
{
// Tell the caller where this chat should be inserted
@@ -330,6 +353,7 @@ QString ChatMessageView::getHistory( Account::ChatExportFormat format, bool &app
if( append )
{
appendPoint = "</body>";
chatStyle_->setAllowEmoticonLinks( oldAllowEmoticonLinks );
return chatHistory;
}
@@ -346,10 +370,12 @@ QString ChatMessageView::getHistory( Account::ChatExportFormat format, bool &app
if( messageRoot.isNull() )
{
kWarning() << "Current style does not define the 'messageRoot' element!";
chatStyle_->setAllowEmoticonLinks( oldAllowEmoticonLinks );
return chatHistory;
}
messageRoot.setInnerHTML( "\n" + chatHistory + "\n" );
chatStyle_->setAllowEmoticonLinks( oldAllowEmoticonLinks );
return copy.toString().string();
}
@@ -407,6 +433,7 @@ QString ChatMessageView::getHistory( Account::ChatExportFormat format, bool &app
+ "\n######################################################################\n" );
}
chatStyle_->setAllowEmoticonLinks( oldAllowEmoticonLinks );
return chatHistory;
}
@@ -415,6 +442,8 @@ QString ChatMessageView::getHistory( Account::ChatExportFormat format, bool &app
break;
}
chatStyle_->setAllowEmoticonLinks( oldAllowEmoticonLinks );
return QString();
}
@@ -435,7 +464,8 @@ QString ChatMessageView::getStyleTag() const
+ chatStyle_->getName() + "-"
+ ( chatStyle_->getUseEmoticons() ? "1" : "0" )
+ ( chatStyle_->getUseFontEffects() ? "1" : "0" )
+ ( chatStyle_->getUseFormatting() ? "1" : "0" );
+ ( chatStyle_->getUseFormatting() ? "1" : "0" )
+ ( chatStyle_->getAllowEmoticonLinks() ? "1" : "0" );
}
@@ -1081,6 +1111,64 @@ void ChatMessageView::updateCustomEmoticon( const QString &code, const QString &
view()->visibleHeight() ) );
}
//
// Creates the default actions for a popup menu. Copy, Select All and Find.
// Attaches them to slots on this class.
//
// Users of this class can add their own entries to the popup menu by getting
// the KMenu instance representing the popup using ChatMessageView::popupMenu().
//
void ChatMessageView::createPopupMenuActions()
{
copyAction_ = KStandardAction::copy( this, SLOT(slotCopyChatText()), this );
selectAllAction_ = KStandardAction::selectAll( this, SLOT(slotSelectAllChatText()), this );
findAction_ = KStandardAction::find( this, SLOT(slotFindChatText()), this );
}
//
// Returns a KMenu containing the "basic" items for a popup menu for a chatmessageview
// These basic items are "Select All", "Copy Text" and "Find text".
//
// NOTE: It is the CALLER'S responsibility to delete the KMenu instance. It is also their
// responsibility to actually show the menu using KMenu::exec().
//
KMenu *ChatMessageView::popupMenu()
{
// Add items to this context menu
KMenu *contextMenu = new KMenu( view() );
// Update the labels a bit though
copyAction_ ->setText( i18n("&Copy Text") );
selectAllAction_ ->setText( i18n("Select &All") );
findAction_ ->setText( i18n("Find &Text..." ) );
contextMenu->addAction( copyAction_ );
contextMenu->addAction( selectAllAction_ );
contextMenu->addAction( findAction_ );
// Set items disabled, depending on the text selection
copyAction_->setEnabled( hasSelection() );
return contextMenu;
}
// The user clicked the "copy text" option in the context menu.
void ChatMessageView::slotCopyChatText()
{
// For HTML use selectedTextAsHTML();
kapp->clipboard()->setText( selectedText() );
}
// The user clicked the "find text" option in the context menu
void ChatMessageView::slotFindChatText()
{
findText();
}
// The user clicked the "select all" option in the context menu.
void ChatMessageView::slotSelectAllChatText()
{
selectAll();
}
#include "chatmessageview.moc"
+15 -3
View File
@@ -22,7 +22,7 @@
#include <KHTMLPart>
#include <KParts/BrowserExtension>
#include <KAction>
class ChatMessage;
class ChatMessageStyle;
@@ -49,7 +49,7 @@ class ChatMessageView : public KHTMLPart
// The destructor
virtual ~ChatMessageView();
// Return the chat history in a specified format
QString getHistory( Account::ChatExportFormat format, bool &append, QString &appendPoint );
QString getHistory( Account::ChatExportFormat format, bool append, QString &appendPoint );
// Return a pointer to the message style parser
ChatMessageStyle *getStyle() const;
// Return a tag to use to compare styles and their options
@@ -62,7 +62,8 @@ class ChatMessageView : public KHTMLPart
void updateCustomEmoticon( const QString &code, const QString &replacement, const QString &handle );
// Replace the entire contents with a new chat in XML
void setXml( const QString &newXmlBody );
// Retrieve the KMenu for the context menu.
KMenu* popupMenu();
public slots:
// Finds the links to add a custom emoticon, and remove them because we've already added that emoticon
@@ -98,6 +99,13 @@ class ChatMessageView : public KHTMLPart
void replaceLastMessage( const QString &text );
// Replace the entire contents with new HTML code
void setHtml( const QString &newHtmlBody );
// Create the context menu actions. Should only get called once.
void createPopupMenuActions();
private slots: // Private slots
void slotCopyChatText();
void slotFindChatText();
void slotSelectAllChatText();
private: // private properties
// Message which was last deleted by a Clear Chat action
@@ -116,6 +124,10 @@ class ChatMessageView : public KHTMLPart
int lastMessageId_;
// The list of custom emoticons which haven't been received yet
QStringList pendingEmoticonTags_;
// The KActions associated with the context menu
KAction* copyAction_;
KAction* selectAllAction_;
KAction* findAction_;
signals:
// Signal that there's an application command
+37 -34
View File
@@ -35,6 +35,7 @@
#include <QRegExp>
#include <QTextCodec>
#include <QTextDocument>
#include <QTextOption>
#include <KAction>
#include <KFileDialog>
@@ -76,6 +77,15 @@ ChatView::ChatView( QWidget *parent )
// Create the containers for this chat's current text and drawing
inkEditContents_ = new InkImage();
messageEditContents_ = new QTextDocument();
// Adapt the new document for RTL is necessary
if( QApplication::isRightToLeft() )
{
QTextOption textOption;
textOption.setTextDirection( Qt::RightToLeft );
messageEditContents_->setDefaultTextOption( textOption );
messageEditContents_->clear();
}
}
@@ -183,6 +193,13 @@ bool ChatView::eventFilter( QObject *obj, QEvent *event )
break;
}
// Ensure that the chat shows the same contents when resizing it
case QEvent::Resize:
{
chatMessageView_->scrollChatToBottom();
break;
}
default:
break;
}
@@ -326,9 +343,10 @@ bool ChatView::saveChatToFile( const QString &path, Account::ChatExportFormat fo
fileData = file.read( 512 );
if( fileData.indexOf( chatMessageView_->getStyleTag() ) == -1 )
{
#ifdef KMESSDEBUG_CHATVIEW
kDebug() << "Style Tag not found in data:" << fileData;
#endif
kWarning() << "Style Tag not found in data:" << fileData << ", writing to a new file";
// we return false, so the caller will write this data to a new file
// TODO: make *this* method decide where to write the data?
return false;
}
}
@@ -336,6 +354,8 @@ bool ChatView::saveChatToFile( const QString &path, Account::ChatExportFormat fo
QString chatHistory( chatMessageView_->getHistory( format, willAppend, appendPoint ) );
#ifdef KMESSDEBUG_CHATVIEW
kDebug() << "Writing to file:" << file.fileName();
kDebug() << "Current file exists?" << isExistingFile << " allow overwriting?" << overwriteContents;
kDebug() << "Will append to current file?" << willAppend;
#endif
@@ -367,13 +387,13 @@ bool ChatView::saveChatToFile( const QString &path, Account::ChatExportFormat fo
chatHistory += fileData.mid( pos );
// Insert the history and tail in the file, below
}
#ifdef KMESSDEBUG_CHATVIEW
else
{
#ifdef KMESSDEBUG_CHATVIEW
kDebug() << "Creating new chat file...";
#endif
file.resize( 0 ); // Truncate it (99% useless precaution)
}
#endif
// Output the chat history to the file, with the right text encoding
QTextStream textStream( &file );
@@ -624,12 +644,6 @@ void ChatView::slotCopyAddress()
// The user clicked the "copy text" option in the context menu.
void ChatView::slotCopyChatText()
{
// For HTML use selectedTextAsHTML();
kapp->clipboard()->setText( chatMessageView_->selectedText() );
}
@@ -760,12 +774,6 @@ void ChatView::scrollToBottom()
// The user clicked the "select all" option in the context menu.
void ChatView::slotSelectAllChatText()
{
chatMessageView_->selectAll();
}
/**
@@ -815,7 +823,10 @@ void ChatView::slotShowContextMenu( const QString &clickedUrl, const QPoint &poi
KAction *urlAction = 0;
// Add items to this context menu
KMenu *contextMenu = new KMenu( chatMessageView_->view() );
KMenu *contextMenu = chatMessageView_->popupMenu();
// separate the "copy/find/select all" actions from the chat-specific ones below.
contextMenu->addSeparator();
// Analyze incoming URL, if present
if( ! clickedUrl.isEmpty() )
@@ -864,16 +875,10 @@ void ChatView::slotShowContextMenu( const QString &clickedUrl, const QPoint &poi
}
// Create items
KAction *copyAction = KStandardAction::copy( this, SLOT(slotCopyChatText()), 0 );
KAction *clearChatAction = KStandardAction::clear( this, SLOT(slotClearChat()), 0 );
KAction *selectAllAction = KStandardAction::selectAll( this, SLOT(slotSelectAllChatText()), 0 );
KAction *saveToFileAction = KStandardAction::save( this, SLOT(showSaveChatDialog()), 0 );
KAction *findAction = KStandardAction::find( this, SLOT(slotFindChatText()), 0 );
// Update the labels a bit though
copyAction ->setText( i18n("&Copy Text") );
selectAllAction ->setText( i18n("Select &All") );
findAction ->setText( i18n("Find &Text..." ) );
clearChatAction ->setText( i18n("C&lear Chat") );
saveToFileAction->setText( i18n("Save Chat to &File...") );
@@ -882,11 +887,6 @@ void ChatView::slotShowContextMenu( const QString &clickedUrl, const QPoint &poi
{
contextMenu->addSeparator();
}
contextMenu->addAction( copyAction );
contextMenu->addAction( selectAllAction );
contextMenu->addAction( findAction );
contextMenu->addSeparator();
contextMenu->addAction( clearChatAction );
contextMenu->addAction( saveToFileAction );
@@ -895,18 +895,21 @@ void ChatView::slotShowContextMenu( const QString &clickedUrl, const QPoint &poi
{
saveToFileAction->setEnabled( false );
}
else
{
copyAction->setEnabled( false );
}
// Only enable the clear chat action if it contains messages
clearChatAction->setEnabled( ! isEmpty() );
// Show the menu
contextMenu->exec( point );
delete contextMenu;
delete copyAction;
delete clearChatAction;
delete saveToFileAction;
if ( urlAction != 0 )
{
delete urlAction;
}
}
-4
View File
@@ -111,14 +111,10 @@ class ChatView : public QWidget
void slotSendAppCommand();
// The user clicked the "copy address" or "copy email" option in the context menu
void slotCopyAddress();
// The user clicked the "copy text" option in the context menu.
void slotCopyChatText();
// Add an emoticon from the chat to the contact's emoticon blacklist
void slotIgnoreEmoticon();
// Open a new url clicked in the khtml widget
void slotOpenURLRequest( const KUrl &url );
// The user clicked the "select all" option in the context menu.
void slotSelectAllChatText();
// The user right clicked at the KHTMLPart to show a popup.
void slotShowContextMenu(const QString &url, const QPoint &point);
// The user clicked the "visit address" or "send email" option in the context menu, or clicked a link in the ChatMessageView
+69 -58
View File
@@ -56,7 +56,7 @@
#include <KToolBar>
#include <KToolInvocation>
#include <KWindowSystem>
#include <KStandardShortcut>
#ifdef KMESSDEBUG_CHATWINDOW
#define KMESSDEBUG_CHATWINDOW_TYPING_MESSAGES
@@ -133,14 +133,18 @@ ChatWindow::ChatWindow( QWidget *parent )
// Add them to the window
setDockOptions( QMainWindow::AnimatedDocks | QMainWindow::AllowTabbedDocks );
addDockWidget( Qt::RightDockWidgetArea, contactsDock_ );
addDockWidget( Qt::RightDockWidgetArea, standardEmoticonsDock_ );
addDockWidget( Qt::RightDockWidgetArea, customEmoticonsDock_ );
Qt::DockWidgetArea position = QApplication::isLeftToRight()
? Qt::RightDockWidgetArea
: Qt::LeftDockWidgetArea;
addDockWidget( position, contactsDock_ );
addDockWidget( position, standardEmoticonsDock_ );
addDockWidget( position, customEmoticonsDock_ );
//Install the event filters to catch events
installEventFilter( this );
inkEdit_ ->installEventFilter( this );
messageEdit_->installEventFilter( this );
winksWidget_->installEventFilter( this );
messageEdit_->viewport()->installEventFilter( this );
// Set the button icons
@@ -417,8 +421,6 @@ void ChatWindow::createMenus()
// Create the actions for "Chat" menu
inviteButton_ = new KAction ( KIcon("list-add-user"), i18n("&Invite..."), this );
sendAction_ = new KAction ( KIcon("folder-remote"), i18n("Send a &File..."), this );
webcamAction_ = new KAction ( KIcon("webcamsend"), i18n("Webcam Chat"), this );
meetingAction_ = new KAction ( KIcon("gnomemeeting"), i18n("Start a &Meeting"), this );
nudgeAction_ = new KAction ( KIcon("preferences-desktop-notification-bell"), i18n("Send a &Nudge!"), this );
saveAction = new KAction ( KIcon("document-save"), i18n("Save Chat..."), this );
closeAllAction_ = new KAction ( KIcon("dialog-close"), i18n("Close &All Tabs"), this );
@@ -448,7 +450,6 @@ void ChatWindow::createMenus()
showMenuBar_ = KStandardAction::showMenubar( this, SLOT( showMenuBar() ), actionCollection_ );
// Add shorter texts for the toolbar items
meetingAction_->setIconText( i18n("Meeting") );
nudgeAction_ ->setIconText( i18n("Nudge") );
sendAction_ ->setIconText( i18n("Send a &File") );
@@ -507,12 +508,8 @@ void ChatWindow::createMenus()
this, SLOT ( slotInviteContact() ) );
connect( sendAction_, SIGNAL( triggered(bool) ),
this, SLOT ( startFileTransfer() ) );
connect( webcamAction_, SIGNAL( triggered(bool) ),
this, SLOT ( startWebcamTransfer() ) );
connect( nudgeAction_, SIGNAL( triggered(bool) ),
this, SLOT ( sendNudge() ) );
connect( meetingAction_, SIGNAL( triggered(bool) ),
this, SLOT ( startMeeting() ) );
connect( saveAction, SIGNAL( triggered(bool) ),
this, SLOT ( saveChat() ) );
connect( closeAllAction_, SIGNAL( triggered() ),
@@ -537,10 +534,6 @@ void ChatWindow::createMenus()
// Add actions to actionCollection for "Chat" menu
actionCollection_->addAction( "send", sendAction_ );
#if ENABLE_WEBCAM
actionCollection_->addAction( "webcam", webcamAction_ );
#endif
actionCollection_->addAction( "meeting", meetingAction_ );
actionCollection_->addAction( "nudge", nudgeAction_ );
actionCollection_->addAction( "save", saveAction );
actionCollection_->addAction( "closeAll", closeAllAction_ );
@@ -563,17 +556,6 @@ void ChatWindow::createMenus()
// Add actions to actionCollection for "Settings" menu
actionCollection_->addAction( "spellCheck", spellCheckAction_ );
#ifdef HAS_KPHONE // If KPhone is not enabled, don't support voice conversation
KAction *conversation = new KAction( "kphone", i18nc( "Menu/toolbar action for voice conversations (KPhone support)",
"Start or Stop a &Conversation"), this );
connect( send, SIGNAL( triggered(bool) ),
this, SLOT ( startConversation() ) );
actionCollection_->addAction( "conversation", conversation );
#endif
}
@@ -722,6 +704,7 @@ bool ChatWindow::eventFilter( QObject *obj, QEvent *event )
// is complex enough as it is now...)
if( obj != messageEdit_ && obj != messageEdit_->viewport()
&& obj != inkEdit_
&& obj != winksWidget_
&& obj != standardEmoticonsWidget_
&& obj != customEmoticonsWidget_ )
{
@@ -841,7 +824,17 @@ bool ChatWindow::eventFilter( QObject *obj, QEvent *event )
}
}
// Another key was pressed: switch to the message editor if needed
// check if this is a Find key sequence. if so, stop it before it gets to the message edit
// this prevents the Ctrl+F key sequence being consumed by KTextEdit.
// KTextEdit does not stop consuming the find/replace key sequences if we disable find/replace
// (bug has been filed with KDE) so this hack is necessary.
if ( KStandardShortcut::find().contains(key | keyEvent->modifiers() ) )
{
editFind();
return true;
}
// Another key was pressed: switch to the message editor if needed
if( editorChooser_->currentWidget() != textPage_ )
{
slotSwitchEditor();
@@ -1467,6 +1460,32 @@ void ChatWindow::sendNudge()
// Sets the window icon for this chat window
void ChatWindow::setChatWindowIcon()
{
Chat *chat = getCurrentChat();
if( chat == 0 )
{
return;
}
QPixmap kmessIcon = KIconLoader::global()->loadIcon( "kmess-shadow", KIconLoader::Panel );
QPixmap userIcon;
if ( chat->getParticipants().size() == 1 )
{
userIcon = KIcon( "user-identity" ).pixmap( 60, 60 );
}
else
{
userIcon = KIcon( "system-users" ).pixmap( 60, 60 );
}
setWindowIcon( KMessShared::drawIconOverlay( userIcon, kmessIcon, kmessIcon.size().width(), kmessIcon.size().height(), .60, .90 ) );
}
// Change the active chat
void ChatWindow::setCurrentChat( Chat *chat )
{
@@ -1496,10 +1515,8 @@ void ChatWindow::setEnabled( bool isEnabled )
// Set the state of the extra contact actions
emoticonAction_ ->setEnabled( isEnabled );
meetingAction_ ->setEnabled( isEnabled );
nudgeAction_ ->setEnabled( isEnabled );
sendAction_ ->setEnabled( isEnabled );
webcamAction_ ->setEnabled( isEnabled );
changeFontAction_ ->setEnabled( isEnabled );
changeFontColorAction_ ->setEnabled( isEnabled );
spellCheckAction_ ->setEnabled( isEnabled );
@@ -1509,8 +1526,15 @@ void ChatWindow::setEnabled( bool isEnabled )
pasteAction_ ->setEnabled( isEnabled );
// Update the winks and handwriting buttons
updateModeButtons();
if( isEnabled )
{
updateModeButtons();
}
else
{
inkButton_ ->setEnabled( false );
winksButton_->setEnabled( false );
}
// The window is being enabled back, replace some stuff which changes
// on every connection
if( isEnabled )
@@ -1526,7 +1550,9 @@ void ChatWindow::setEnabled( bool isEnabled )
// Enable or disable the parts of the window which allow user interaction
void ChatWindow::setUIState( UIState state )
{
switch( state)
uiState_ = state;
switch( state )
{
case Disconnecting:
case Disconnected:
@@ -2181,6 +2207,8 @@ void ChatWindow::slotTabChanged( int currentIndex )
}
#endif
// update the icon for this window appropriately.
setChatWindowIcon();
// Reset the color
const QPalette palette;
@@ -2293,6 +2321,12 @@ void ChatWindow::slotUpdateChatInfo( Chat *chat )
const QStringList& participantsList( chat->getParticipants() );
if ( chat == getCurrentChat() )
{
// update the icon for this window appropriately.
setChatWindowIcon();
}
// getCaption() should return a properly html-escaped string
QString chatCaption( chat->getCaption() );
@@ -2346,14 +2380,6 @@ void ChatWindow::slotUpdateChatInfo( Chat *chat )
// Start a voice conversation
void ChatWindow::startConversation()
{
getCurrentChat()->startConversation();
}
// Start a file transfer
void ChatWindow::startFileTransfer()
{
@@ -2362,22 +2388,6 @@ void ChatWindow::startFileTransfer()
// Start GnomeMeeting with a contact.
void ChatWindow::startMeeting()
{
getCurrentChat()->startMeeting();
}
// Start a file transfer
void ChatWindow::startWebcamTransfer()
{
getCurrentChat()->startWebcamTransfer();
}
// Called when the "use emoticons" action is called.
void ChatWindow::toggleEmoticons( bool useEmoticons )
{
@@ -2418,8 +2428,9 @@ void ChatWindow::toggleSpellCheck( bool useSpellCheck )
// Update the status of the tiny writing mode buttons
void ChatWindow::updateModeButtons()
{
// don't do anything when the window / chat was just closed
if( getCurrentChat() == NULL )
// don't do anything when the window
// chat was just closed or user is not connected
if( getCurrentChat() == NULL || uiState_ != Connected)
{
return;
}
+4 -10
View File
@@ -114,6 +114,8 @@ class ChatWindow : public KXmlGuiWindow, private Ui::ChatWindow
void saveProperties( KConfigGroup &config = *((KConfigGroup *)0) );
// Enable or disable the parts of the window which allow user interaction
void setEnabled( bool isEnabled );
// Set the window icon for this chat window
void setChatWindowIcon();
public slots:
// Show a status message temporarily in the status dialog
@@ -190,14 +192,8 @@ class ChatWindow : public KXmlGuiWindow, private Ui::ChatWindow
bool slotTabRemoved( QWidget *chatWidget );
// Update the editor's font to match the account's font
void updateEditorFont();
// Start a voice conversation
void startConversation();
// Start a file transfer
void startFileTransfer();
// Start GnomeMeeting with a contact.
void startMeeting();
// Start a webcam transfer
void startWebcamTransfer();
// Called when the "use emoticons" action is called.
void toggleEmoticons( bool useEmoticons );
// Called when the "show session messages" action is called.
@@ -254,8 +250,6 @@ class ChatWindow : public KXmlGuiWindow, private Ui::ChatWindow
QString lastSentence_;
// The last time the window was shaked
QTime lastShake_;
// Action to open a meeting
KAction *meetingAction_;
// Action to switch to the next tab
KAction *nextTabAction_;
// Action to send a nudge
@@ -282,10 +276,10 @@ class ChatWindow : public KXmlGuiWindow, private Ui::ChatWindow
QTimer statusTimer_;
// A timer to time whether a "user is typing" message should be sent.
QTimer userTypingTimer_;
// Action to start a webcam transfer
KAction *webcamAction_;
// Stores the current level of zoom
int zoomLevel_;
// Store the Gui state
UIState uiState_;
signals: // Public signals
// Signal that the window is about to close.
+1 -5
View File
@@ -1,14 +1,11 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<gui name="kmess" version="9">
<gui name="kmess" version="10">
<MenuBar>
<Menu name="file" noMerge="1" >
<text context="@title:menu">&amp;Chat</text>
<Action name="invite" />
<Separator/>
<Action name="send" />
<Action name="webcam" />
<Action name="meeting" />
<Action name="conversation" />
<Action name="nudge" />
<Separator/>
<Action name="save" />
@@ -37,7 +34,6 @@
<text context="@title:menu">Main Toolbar</text>
<Action name="invite" />
<Action name="send" />
<Action name="webcam" />
<Action name="nudge" />
<Separator/>
<Action name="contactsDock" />
+8 -2
View File
@@ -255,8 +255,9 @@ bool ContactFrame::eventFilter( QObject *obj, QEvent *event )
KIconEffect::toGamma( image, 0.8f );
contactPixmapLabel_->setPixmap( QPixmap::fromImage( image ) );
}
else if( eventType == QEvent::Leave )
else if( eventType == QEvent::Leave && !typingTimer_.isActive() )
{
// Only disable glow effect when the contact is not typing
contactPixmapLabel_->setPixmap( QPixmap::fromImage( image ) );
}
}
@@ -730,7 +731,12 @@ void ContactFrame::updatePicture()
// Display the image
contactPixmapLabel_->setPixmap( contactPicture_ );
contactPixmapLabel_->setMinimumSize( contactImage.width(), contactImage.height() );
// only change min size for images smaller than 96x96
if ( contactImage.width() < 96 && contactImage.height() < 96 )
{
contactPixmapLabel_->setMinimumSize( contactImage.width(), contactImage.height() );
}
}
+135 -88
View File
@@ -1,75 +1,76 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ContactFrame</class>
<widget class="QWidget" name="ContactFrame" >
<property name="geometry" >
<widget class="QWidget" name="ContactFrame">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>112</width>
<height>149</height>
<width>350</width>
<height>309</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<property name="spacing" >
<number>1</number>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin" >
<number>4</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>12</number>
</property>
<property name="bottomMargin" >
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<property name="spacing" >
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="statusPixmapLabel_" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<widget class="QLabel" name="statusPixmapLabel_">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="scaledContents" >
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="wordWrap" >
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="friendlyNameLabel_" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<widget class="GradientElideLabel" name="friendlyNameLabel_">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="textFormat" >
<property name="minimumSize">
<size>
<width>64</width>
<height>20</height>
</size>
</property>
<property name="styleSheet">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
@@ -77,82 +78,121 @@
</layout>
</item>
<item>
<widget class="QLabel" name="infoLabel_" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<widget class="GradientElideLabel" name="infoLabel_">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font" >
<property name="minimumSize">
<size>
<width>64</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<italic>true</italic>
</font>
</property>
<property name="textFormat" >
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="contactPixmapLabel_" >
<property name="enabled" >
<bool>true</bool>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>96</width>
<height>96</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>96</width>
<height>96</height>
</size>
</property>
<property name="cursor" >
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="focusPolicy" >
<enum>Qt::ClickFocus</enum>
</property>
<property name="toolTip" >
<string>Click here to display the menu for this contact</string>
</property>
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Sunken</enum>
</property>
<property name="textFormat" >
<enum>Qt::PlainText</enum>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
<property name="textInteractionFlags" >
<set>Qt::NoTextInteraction</set>
</property>
</widget>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="contactPixmapLabel_">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>96</width>
<height>96</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>96</width>
<height>96</height>
</size>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="toolTip">
<string>Click here to display the menu for this contact</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer" >
<property name="orientation" >
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>12</width>
<height>12</height>
@@ -162,8 +202,15 @@
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>GradientElideLabel</class>
<extends>QLabel</extends>
<header>utils/gradientelidelabel.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+3 -1
View File
@@ -37,11 +37,13 @@ ContactsWidget::ContactsWidget( QWidget *parent )
{
setupUi( this );
container_->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
// Create the layout which will organize the contact frames
layout_ = new QBoxLayout( QBoxLayout::TopToBottom, container_ );
layout_->setSpacing( 2 );
layout_->setContentsMargins( 0, 0, 0, 0 );
layout_->setSizeConstraint( QLayout::SetMinAndMaxSize );
//layout_->setSizeConstraint( QLayout::SetMinAndMaxSize );
layout_->setAlignment( Qt::AlignTop | Qt::AlignLeft );
// The scroll area background should mimetize with the rest of the app
+3 -3
View File
@@ -32,15 +32,15 @@
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="widgetResizable">
<bool>false</bool>
<bool>true</bool>
</property>
<widget class="QWidget" name="container_">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>94</width>
<height>120</height>
<width>221</width>
<height>190</height>
</rect>
</property>
<property name="styleSheet">
+1 -14
View File
@@ -333,20 +333,7 @@ void EmoticonsWidget::slotThemeUpdated()
item->setData( PictureRole, emoticon->getPicturePath() );
// Add the emoticon tooltip
QString tooltip;
// Check if the current emoticon is custom to avoid problem with chars encode.
// The htmlEscape method put the #39; chars instead of ' in the standard emoticon description
if( isCustom_ )
{
tooltip = KMessShared::htmlEscape( emoticon->getTooltip() );
}
else
{
tooltip = emoticon->getTooltip();
}
item->setToolTip( tooltip );
item->setToolTip( emoticon->getTooltip() );
}
#ifdef KMESSDEBUG_EMOTICONSWIDGET
+9
View File
@@ -159,9 +159,18 @@ void WinksWidget::refresh()
}
}
QString winkFriendly;
QFile handle( winksDir_ + file + ".name" );
if( handle.open( QIODevice::ReadOnly ) )
{
winkFriendly = handle.readAll();
handle.close();
}
// Add the item
QListWidgetItem *item = new QListWidgetItem( KIcon( iconPath ), "", list_ );
item->setData( Qt::UserRole, file );
item->setToolTip( winkFriendly );
}
}
}
+8
View File
@@ -221,6 +221,14 @@ KMenu *MsnStatus::getStatusMenu()
statusMenu_->addAction( action );
}
/* TODO: After the AccountCurrentAccount rewrite, move the MsnStatus menu's signal connection
from class KMessInterface::initialize() to here, with something like:
connect( status_, SIGNAL( triggered(QAction*) ),
currentAccount_, SLOT ( changeStatus(QAction*) ) );
To avoid adding such a stupid slot on CurrentAccount, it'd be better to add it
somewhere else (here?) to get the Status out of the QAction.
*/
return statusMenu_;
}
+1
View File
@@ -56,6 +56,7 @@ AddEmoticonDialog::AddEmoticonDialog( EmoticonTheme *theme, QWidget *parent )
// Configure the dialog
setWindowModality( Qt::WindowModal );
setButtons( Help | Ok | Cancel );
setHelp( "settings-account-emoticons" );
setDefaultButton( Ok );
setCaption( i18n("Add New Emoticon") );
+62 -28
View File
@@ -20,6 +20,7 @@
#include "../chat/chatmessagestyle.h"
#include "../chat/chatmessageview.h"
#include "../utils/kmessconfig.h"
#include "../utils/kmessshared.h"
#include "../currentaccount.h"
#include "../kmessdebug.h"
@@ -29,10 +30,16 @@
#include <QSortFilterProxyModel>
#include <QtXml/QDomDocument>
#include <QtXml/QDomNode>
#include <QClipboard>
#include <KApplication>
#include <KMessageBox>
#include <KLocalizedString>
#include <KDateTime>
#include <KMenu>
#include <KAction>
#include <KHTMLView>
#include <KStandardAction>
#ifdef KMESSDEBUG_CHATHISTORYDIALOG
@@ -53,16 +60,24 @@ ChatHistoryDialog::ChatHistoryDialog( QWidget *parent )
QWidget *mainWidget = new QWidget( this );
setupUi( mainWidget );
setMainWidget( mainWidget );
setButtons( Close );
setButtons( Help | Close );
setHelp( "using-chat-history" );
setWindowTitle( i18nc( "Dialog window title", "Chat History" ) );
loadingLabel_->hide();
// Let the dialog destroy itself when it's done
setAttribute( Qt::WA_DeleteOnClose );
// Set a nice icon
setWindowIcon( KMessShared::drawIconOverlay( KIconLoader::global()->loadIcon( "kmess", KIconLoader::Panel ), KIcon( "chronometer" ).pixmap( 20, 20 ) ) );
// Create the chat view to show the chat logs
chatView_ = new ChatMessageView( mainWidget );
connect( chatView_, SIGNAL( popupMenu(const QString&,const QPoint&) ),
this, SLOT ( slotShowContextMenu(const QString&,const QPoint&) ) );
chatView_->updateChatStyle();
chatView_->getStyle()->setAllowEmoticonLinks( false );
rightSplitter_->addWidget( chatView_->widget() );
// Make the splitter assign more space to the view than to the controls,
@@ -266,13 +281,20 @@ void ChatHistoryDialog::cacheContactXml( const QModelIndex &index )
}
#ifdef KMESSDEBUG_CHATHISTORYDIALOG_VERBOSE
kDebug() << "Adding conversation to log parser thread...";
kDebug() << "Adding conversation" << entry.fileName() << "to log parser thread...";
#endif
logParser_->addDocument( entry.fileName(), file.readAll() );
file.close();
}
// start the thread
if( logParser_ != 0 && !logParser_->isRunning() )
{
kDebug() << "Starting the log parser thread!";
logParser_->start( QThread::HighPriority );
}
if( list.isEmpty() )
{
setLoading( false );
@@ -359,17 +381,23 @@ void ChatHistoryDialog::loadContactsList()
// Add them to the list
const QFileInfoList &list = logsDir.entryInfoList();
QHash<QString, bool> loadedHandles;
foreach( const QFileInfo &entry, list )
{
QString handle( entry.fileName() );
handle.remove( handle.length() - 4, 4 );
// Files ending with .1 should not be added
// strip off the number information too.
if( handle.at( handle.length() - 1 ).isNumber() )
{
continue;
handle.truncate( handle.lastIndexOf( '.' ) );
}
// now, only add the handle if it hasn't already been loaded.
if ( loadedHandles.contains( handle ) ) continue;
loadedHandles.insert( handle, true );
model_->appendRow( new QStandardItem( handle ) );
}
}
@@ -388,6 +416,7 @@ void ChatHistoryDialog::reloadLogs()
connect( reloadLogsTimer_, SIGNAL( timeout() ),
this, SLOT ( reloadLogs() ) );
}
if( reloadLogsTimer_ != sender() )
{
#ifdef KMESSDEBUG_CHATHISTORYDIALOG
@@ -629,11 +658,6 @@ XmlLogParser::XmlLogParser( bool showDate, bool showTime, bool showSeconds )
void XmlLogParser::addDocument( const QString &fileName, const QByteArray &newDocument )
{
documents_[ fileName ] = newDocument;
if( ! isRunning() )
{
start( QThread::HighPriority );
}
}
@@ -642,9 +666,21 @@ void XmlLogParser::addDocument( const QString &fileName, const QByteArray &newDo
void XmlLogParser::end()
{
disconnect( this );
end_ = true;
end_ = true;
// quit() here makes the threads exec() return, so it effectively "detaches"
// from the main program; however, the run() method stays running until it's
// done with the current document and it notices end_ is true. If that takes
// more than the 5 seconds (in the wait() call below), it is terminated.
quit();
// Wait 5s for the thread to finish: if it's not enough, kill it
wait( 5000 );
if( isRunning() )
{
terminate();
}
deleteLater();
}
@@ -659,9 +695,10 @@ void XmlLogParser::run()
while( ! documents_.isEmpty() )
{
// take the first document from the hash for processing
QHash<const QString,QByteArray>::iterator it = documents_.begin();
const QString &fileName = it.key();
QByteArray &documentBytes = it.value();
const QString fileName = it.key();
const QByteArray documentBytes = documents_.take( fileName );
QDomDocument document;
document.setContent( documentBytes );
@@ -695,12 +732,6 @@ void XmlLogParser::run()
continue;
}
if( end_ )
{
kWarning() << "Caught end, closing.";
return;
}
if ( showDate_ )
{
message.setAttribute( "time", KGlobal::locale()->formatDateTime( datetime, KLocale::ShortDate, showSeconds_ ) );
@@ -740,12 +771,6 @@ void XmlLogParser::run()
continue;
}
if( end_ )
{
kWarning() << "Caught end, closing.";
return;
}
// Change it to a <messageRoot> so that it'll be readily usable when selected
conversation.setTagName( "messageRoot" );
// conversation.removeAttribute( "timestamp" ); // Ignored by ChatMessageView?
@@ -753,12 +778,12 @@ void XmlLogParser::run()
emit gotConversation( timestamp, conversation );
}
// Document done, remove it from the queue
documents_.remove( fileName );
// if we're supposed to stop processing now, just stop.
if( end_ )
{
kWarning() << "Caught end, closing.";
#ifdef KMESSDEBUG_CHATHISTORYDIALOG_VERBOSE
kDebug() << "Caught end, closing.";
#endif
return;
}
}
@@ -769,5 +794,14 @@ void XmlLogParser::run()
}
// The user right clicked at the KHTMLPart to show a popup.
void ChatHistoryDialog::slotShowContextMenu( const QString &clickedUrl, const QPoint &point )
{
Q_UNUSED( clickedUrl )
KMenu *popup = chatView_->popupMenu();
popup->exec( point );
delete popup;
}
#include "chathistorydialog.moc"
+3 -1
View File
@@ -23,6 +23,7 @@
#include <QMap>
#include <QMutex>
#include <QThread>
#include <QPoint>
#include <KDialog>
@@ -65,7 +66,8 @@ class ChatHistoryDialog : public KDialog, private Ui::historyDialog
void reloadLogs();
// Set whether the dialog is loading chats or not
void setLoading( bool isLoading = false );
// Show the context menu for the chat message view
void slotShowContextMenu( const QString &clickedUrl, const QPoint &point );
private:
// Mutex to watch over the chats addition
QMutex addConversationLock_;

Some files were not shown because too many files have changed in this diff Show More