kuassel: refactiring

Here is a short list of what exactly changed:
 - made it run only single instance via KUniqueApplication
 - make it store config and data in KDE directories
 - added irc protocol service provider files for use in KDE
 - removed Dock and Phonon notification support
 - removed Web links preview support
 - rebranded (incomplete, but mostly done)

Things that need doing:
 - use KDE localiztion implementation
 - the --url argument needed for the service does not actually join
 - use KStyle instead of stylesheets?
 - implement a help menu like other KDE apps
 - integrate with various KDE parts?
This commit is contained in:
Ivailo Monev 2014-12-30 16:16:27 +00:00
parent 93e5a64715
commit b198db5877
131 changed files with 564 additions and 221460 deletions

View file

@ -32,7 +32,6 @@ include(FeatureSummary)
# ... and our own stuff
include(QuasselCompileSettings)
include(QuasselMacros)
# Setting COMPILE_DEFINITIONS_<CONFIG> is deprecated since CMake 3.0 in favor of generator expressions.
# These have existed since CMake 2.8.10; until we depend on that, we have to explicitly enable the old policy.
@ -43,9 +42,6 @@ endif()
# Options and variables that can be set on the command line
#####################################################################
# For this, the feature info is added after we know if QtWebkit is installed
option(WITH_WEBKIT "WebKit support (for link previews)" ON)
# Handle with care
set(QT_PATH "" CACHE PATH "Path to a Qt4 installation to use instead of the system Qt (e.g. for static builds)")
@ -88,11 +84,6 @@ if (QT_QTDBUS_FOUND)
)
endif()
if (WITH_WEBKIT AND QT_QTWEBKIT_FOUND)
set(HAVE_WEBKIT true)
endif()
add_feature_info("WITH_WEBKIT and QtWebKit module" HAVE_WEBKIT "Support showing previews for URLs in chat")
find_package(KDE4 4.4 QUIET REQUIRED)
set_package_properties(KDE4 PROPERTIES TYPE REQUIRED
URL "http://www.kde.org"
@ -144,16 +135,13 @@ set_package_properties(ExecInfo PROPERTIES TYPE OPTIONAL
# Various checks
#####################################################################
add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS})
add_definitions(${KDE4_DEFINITIONS})
# Check for SSL support in Qt
# As there's no easy way to get Qt's configuration in particular for Qt5, let's just compile
# a small test program checking the defines. This works for both Qt4 and Qt5.
cmake_push_check_state(RESET)
if (Qt5_POSITION_INDEPENDENT_CODE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES} ${Qt5Core_INCLUDE_DIRS})
set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES})
check_cxx_source_compiles("
#include \"qglobal.h\"
#if defined QT_NO_OPENSSL || defined QT_NO_SSL
@ -227,7 +215,6 @@ set(CLIENT_DEPS )
# Add needed subdirs - the order is important, since src needs some vars set by other dirs
add_subdirectory(data)
add_subdirectory(pics)
add_subdirectory(po)
# Set up and display feature summary
#####################################################################

View file

@ -1,286 +0,0 @@
# Doxyfile 1.5.3
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "Quassel IRC "
PROJECT_NUMBER = Pre-Release
OUTPUT_DIRECTORY = doc
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class " \
"The $name widget " \
"The $name file " \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = YES
FULL_PATH_NAMES = NO
STRIP_FROM_PATH = /
STRIP_FROM_INC_PATH = /home/sputnick/devel/local-quassel/
SHORT_NAMES = YES
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = YES
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = YES
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = YES
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = YES
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = NO
SORT_BRIEF_DOCS = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text "
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = src
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.idl \
*.odl \
*.cs \
*.php \
*.php3 \
*.inc \
*.m \
*.mm \
*.dox \
*.C \
*.CC \
*.C++ \
*.II \
*.I++ \
*.H \
*.HH \
*.H++ \
*.CS \
*.PHP \
*.PHP3 \
*.M \
*.MM \
*.C \
*.H \
*.tlh \
*.diff \
*.patch \
*.moc \
*.xpm \
*.dox
RECURSIVE = YES
EXCLUDE = src/contrib
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
HTML_DYNAMIC_SECTIONS = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = YES
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH = /usr/include/qt4
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = NO
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE = quassel.tag
ALLEXTERNALS = YES
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = YES
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = YES

View file

@ -58,13 +58,7 @@ it later in the same build directory, you don't need to specify them again.
Quassel supports several options to enable or disable features, and can make
use of several optional dependencies if installed. CMake will give a nice
summary of all that after its run, so we'll just mention the most important
options here:
-DWITH_WEBKIT=OFF
Use Webkit for showing previews of webpages linked in the chat. Requires
the QtWebkit module to be available, and increases the client's RAM usage
by *a lot* if enabled at runtime.
summary of all that after its run.
You can find the list of optional packages for additional features in CMake's
feature summary; install missing packages for enabling the functionality listed

3
kuassel/Messages.sh Normal file
View file

@ -0,0 +1,3 @@
#! /bin/sh
$EXTRACTRC `find . -name "*.rc" -o -name "*.ui" -o -name "*.kcfg"` >> rc.cpp || exit 11
$XGETTEXT $(find . -name "*.cpp" -o -name "*.h") -o $podir/kuassel.pot

View file

@ -77,9 +77,3 @@ else()
message(WARNING "Unknown or unsupported compiler. Make sure to enable C++11 support. Good luck.")
endif()
# Mac build stuff
if (APPLE AND DEPLOY)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.8")
set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk")
endif()

View file

@ -1,44 +0,0 @@
# This file contains various macros useful for building Quassel.
#
# (C) 2014 by the Quassel Project <devel@quassel-irc.org>
#
# The qt4_use_modules function was taken from CMake's Qt4Macros.cmake:
# (C) 2005-2009 Kitware, Inc.
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
######################################
# Macros for dealing with translations
######################################
# This generates a .ts from a .po file
macro(generate_ts outvar basename)
set(input ${basename}.po)
set(output ${CMAKE_BINARY_DIR}/po/${basename}.ts)
add_custom_command(OUTPUT ${output}
COMMAND ${QT_LCONVERT_EXECUTABLE}
ARGS -i ${input}
-of ts
-o ${output}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po
# This is a workaround to add (duplicate) strings that lconvert missed to the .ts
COMMAND ${QT_LUPDATE_EXECUTABLE}
ARGS -silent
${CMAKE_SOURCE_DIR}/src/
-ts ${output}
DEPENDS ${basename}.po)
set(${outvar} ${output})
endmacro(generate_ts outvar basename)
# This generates a .qm from a .ts file
macro(generate_qm outvar basename)
set(input ${CMAKE_BINARY_DIR}/po/${basename}.ts)
set(output ${CMAKE_BINARY_DIR}/po/${basename}.qm)
add_custom_command(OUTPUT ${output}
COMMAND ${QT_LRELEASE_EXECUTABLE}
ARGS -silent
${input}
DEPENDS ${basename}.ts)
set(${outvar} ${output})
endmacro(generate_qm outvar basename)

View file

@ -1,9 +1,7 @@
if (KDE4_FOUND OR (UNIX AND NOT APPLE))
install(FILES quassel.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES kuassel.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES kuassel.notifyrc DESTINATION ${DATA_INSTALL_DIR}/kuassel)
install(FILES kuasirc.protocol kuasircs.protocol kuasirc6.protocol DESTINATION ${SERVICES_INSTALL_DIR})
install(FILES quassel.notifyrc DESTINATION ${DATA_INSTALL_DIR}/quassel)
endif()
install(FILES networks.ini DESTINATION ${DATA_INSTALL_DIR}/quassel)
install(DIRECTORY stylesheets DESTINATION ${DATA_INSTALL_DIR}/quassel)
install(DIRECTORY scripts DESTINATION ${DATA_INSTALL_DIR}/quassel USE_SOURCE_PERMISSIONS)
install(FILES networks.ini DESTINATION ${DATA_INSTALL_DIR}/kuassel)
install(DIRECTORY stylesheets DESTINATION ${DATA_INSTALL_DIR}/kuassel)
install(DIRECTORY scripts DESTINATION ${DATA_INSTALL_DIR}/kuassel USE_SOURCE_PERMISSIONS)

View file

@ -0,0 +1,11 @@
[Protocol]
exec=kuassel --url %u
protocol=irc
input=none
output=none
helper=true
listing=false
reading=false
writing=false
makedir=false
deleting=false

View file

@ -0,0 +1,11 @@
[Protocol]
exec=kuassel --url %u
protocol=irc6
input=none
output=none
helper=true
listing=false
reading=false
writing=false
makedir=false
deleting=false

View file

@ -0,0 +1,11 @@
[Protocol]
exec=kuassel --url %u
protocol=ircs
input=none
output=none
helper=true
listing=false
reading=false
writing=false
makedir=false
deleting=false

View file

@ -1,30 +1,29 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=Quassel IRC
Name[ast]=Quassel IRC
Name[ca]=Xat IRC Quassel
Name[de]=Quassel IRC
Name[en_GB]=Quassel IRC
Name[es]=IRC Quassel
Name[et]=Quassel IRC
Name[fi]=Quassel IRC
Name[fr]=Quassel IRC
Name[gl]=IRC Quassel
Name[hu]=Quassel IRC
Name[it]=Quassel IRC
Name[ko]=Quassel IRC
Name[nb]=Quassel IRC
Name[nl]=Quassel IRC
Name[oc]=Quassel IRC
Name[pl]=Quassel IRC
Name[pt_BR]=Quassel IRC
Name[ru]=Quassel IRC
Name[sq]=Quassel IRC
Name[sv]=Quassel IRC
Name[tr]=Quassel IRC
Name[uk]=Quassel IRC
Name[zh_CN]=Quassel IRC
Name=Kuassel
Name[ast]=Kuassel
Name[de]=Kuassel
Name[en_GB]=Kuassel
Name[es]=Kuassel
Name[et]=Kuassel
Name[fi]=Kuassel
Name[fr]=Kuassel
Name[gl]=Kuassel
Name[hu]=Kuassel
Name[it]=Kuassel
Name[ko]=Kuassel
Name[nb]=Kuassel
Name[nl]=Kuassel
Name[oc]=Kuassel
Name[pl]=Kuassel
Name[pt_BR]=Kuassel
Name[ru]=Kuassel
Name[sq]=Kuassel
Name[sv]=Kuassel
Name[tr]=Kuassel
Name[uk]=Kuassel
Name[zh_CN]=Kuassel
GenericName=IRC Client
GenericName[ast]=Veceru IRC
GenericName[ca]=Client d'IRC
@ -69,7 +68,7 @@ Comment[sq]=Klient i shpërndarë IRC me përbërës qendror
Comment[sv]=Distribuerad IRC-klient med central kärnkomponent
Comment[uk]=Клієнт IRC з центральним ядром
Comment[zh_CN]= IRC
Icon=quassel
TryExec=quassel
Exec=quassel
Icon=kuassel
TryExec=kuassel
Exec=kuassel
Categories=Qt;Network;Chat;IRCClient;

View file

@ -1,29 +1,28 @@
[Global]
IconName=quassel
Comment=Quassel IRC
Comment[ast]=Quassel IRC
Comment[ca]=Xat IRC Quassel
Comment[de]=Quassel IRC
Comment[en_GB]=Quassel IRC
Comment[es]=IRC Quassel
Comment[et]=Quassel IRC
Comment[fi]=Quassel IRC
Comment[fr]=Quassel IRC
Comment[gl]=IRC Quassel
Comment[hu]=Quassel IRC
Comment[it]=Quassel IRC
Comment[ko]=Quassel IRC
Comment[nb]=Quassel IRC
Comment[nl]=Quassel IRC
Comment[oc]=Quassel IRC
Comment[pl]=Quassel IRC
Comment[pt_BR]=Quassel IRC
Comment[ru]=Quassel IRC
Comment[sq]=Quassel IRC
Comment[sv]=Quassel IRC
Comment[tr]=Quassel IRC
Comment[uk]=Quassel IRC
Comment[zh_CN]=Quassel IRC
IconName=kuassel
Comment=Kuassel
Comment[ast]=Kuassel
Comment[de]=Kuassel
Comment[en_GB]=Kuasse
Comment[es]=Kuassel
Comment[et]=Kuassel
Comment[fi]=Kuassel
Comment[fr]=Kuassel
Comment[gl]=Kuassel
Comment[hu]=Kuassel
Comment[it]=Kuassel
Comment[ko]=Kuassel
Comment[nb]=Kuassel
Comment[nl]=Kuassel
Comment[oc]=Kuassel
Comment[pl]=Kuassel
Comment[pt_BR]=Kuassel
Comment[ru]=Kuassel
Comment[sq]=Kuassel
Comment[sv]=Kuassel
Comment[tr]=Kuassel
Comment[uk]=Kuassel
Comment[zh_CN]=Kuassel
[Event/Highlight]
Name=Highlight
@ -84,21 +83,21 @@ Name[pt_BR]=Realçar quando focado
Name[sq]=Përzgjidh kur fokusohet
Name[uk]=Підсвічування у фокусі
Name[zh_CN]=被聚焦时高亮显示
Comment=A highlighted message has arrived while Quassel is focused
Comment[ast]=Aportó un mensax resaltáu mientres s'enfocaba Quassel
Comment[ca]=Ha arribat un missatge realçat mentre el Quassel tenia el focus
Comment[de]=Eine hervorgehobene Nachricht ist angekommen, während Quassel fokussiert war
Comment[en_GB]=A highlighted message has arrived while Quassel is focused
Comment[es]=Ha llegado un mensaje resaltado mientras se enfocaba Quassel
Comment[et]=Kui Quassel on fokusseeritud saabus esiletõstetud sõnum
Comment[gl]=Chegou unha mensaxee resaltada mentres se enfocaba Quassel
Comment[it]=È arrivato un nuovo messaggio evidenziato mentre Quassel è in primo piano
Comment[nb]=En uthevet beskjed er mottatt mens Quassel har fokus
Comment=A highlighted message has arrived while Kuassel is focused
Comment[ast]=Aportó un mensax resaltáu mientres s'enfocaba Kuassel
Comment[ca]=Ha arribat un missatge realçat mentre el Kuassel tenia el focus
Comment[de]=Eine hervorgehobene Nachricht ist angekommen, während Kuassel fokussiert war
Comment[en_GB]=A highlighted message has arrived while Kuassel is focused
Comment[es]=Ha llegado un mensaje resaltado mientras se enfocaba Kuassel
Comment[et]=Kui Kuassel on fokusseeritud saabus esiletõstetud sõnum
Comment[gl]=Chegou unha mensaxee resaltada mentres se enfocaba Kuassel
Comment[it]=È arrivato un nuovo messaggio evidenziato mentre Kuassel è in primo piano
Comment[nb]=En uthevet beskjed er mottatt mens Kuassel har fokus
Comment[nl]=Een geaccentueerd bericht is ontvangen terwijl het Quessel-venster actief is
Comment[pt_BR]=Mensagem realçada quando chegar enquando o Quassel estiver focado
Comment[sq]=një mesazh i përzgjedhur ka mbërritur kur Quassel ishte në fokus
Comment[uk]=Під час перебування Quassel у фокусі надійшло підсвічене повідомлення
Comment[zh_CN]=当Quassel被聚焦时收到一条高亮显示的信息
Comment[pt_BR]=Mensagem realçada quando chegar enquando o Kuassel estiver focado
Comment[sq]=një mesazh i përzgjedhur ka mbërritur kur Kuassel ishte në fokus
Comment[uk]=Під час перебування Kuassel у фокусі надійшло підсвічене повідомлення
Comment[zh_CN]=当Kuassel被聚焦时收到一条高亮显示的信息
Sound=KDE-Im-Highlight-Msg.ogg
Action=Taskbar
@ -154,24 +153,24 @@ Name[en_GB]=Private message when focused
Name[es]=Mensaje privado cuando está en el foco
Name[gl]=Mensaxe privada cando está en foco
Name[it]=Messaggio privato mentre in primo piano
Name[nl]=Privé-bericht terwijl het Quassel-venster actief is
Name[nl]=Privé-bericht terwijl het Kuassel-venster actief is
Name[pt_BR]=Mensagem privada quando focada
Name[sq]=Mesazh Privat kur Fokusohet
Name[sv]=Privat meddelande när fokuserad
Name[uk]=Особисте повідомлення під час фокусування
Name[zh_CN]=被聚焦时的私人短信息
Comment=A private message (query) has arrived while Quassel is focused
Comment[ast]=Aportó un mensax priváu (consulta) mientres s'enfocaba Quassel
Comment[ca]=Ha arribat un missatge privat (sol·licitud) mentre el Quassel tenia el focus
Comment[de]=Eine private Nachricht (Anfrage) ist angekommen, während Quassel fokussiert war
Comment[en_GB]=A private message (query) has arrived while Quassel is focused
Comment[es]=Ha llegado un mensaje privado (consulta) mientras se enfocaba Quassel
Comment[gl]=Chegou unha mensaxe privada (consulta) mentres se enfocaba Quassel
Comment[it]=È arrivato un messaggio privato (query) mentre Quassel è in primo piano
Comment[nl]=Een privé-bericht (query) is ontvangen terwijl het Quassel-venster actief is
Comment[pt_BR]=Uma mensagem privada (consulta) chegou enquanto o Quassel está focado
Comment[sq]=Një masazh privat (kërkesë) ka mbërritur kur Quassel ishte i fokusuar
Comment[uk]=Під час перебування Quassel у фокусі надійшло особисте повідомлення (повідомлення з діалогу)
Comment[zh_CN]=当Quassel被聚焦时收到一条私人短信息疑问
Comment=A private message (query) has arrived while Kuassel is focused
Comment[ast]=Aportó un mensax priváu (consulta) mientres s'enfocaba Kuassel
Comment[ca]=Ha arribat un missatge privat (sol·licitud) mentre el Kuassel tenia el focus
Comment[de]=Eine private Nachricht (Anfrage) ist angekommen, während Kuassel fokussiert war
Comment[en_GB]=A private message (query) has arrived while Kuassel is focused
Comment[es]=Ha llegado un mensaje privado (consulta) mientras se enfocaba Kuassel
Comment[gl]=Chegou unha mensaxe privada (consulta) mentres se enfocaba Kuassel
Comment[it]=È arrivato un messaggio privato (query) mentre Kuassel è in primo piano
Comment[nl]=Een privé-bericht (query) is ontvangen terwijl het Kuassel-venster actief is
Comment[pt_BR]=Uma mensagem privada (consulta) chegou enquanto o Kuassel está focado
Comment[sq]=Një masazh privat (kërkesë) ka mbërritur kur Kuassel ishte i fokusuar
Comment[uk]=Під час перебування Kuassel у фокусі надійшло особисте повідомлення (повідомлення з діалогу)
Comment[zh_CN]=当Kuassel被聚焦时收到一条私人短信息疑问
Sound=KDE-Im-Message-In.ogg
Action=Taskbar

View file

@ -1,23 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DockItem">
<method name="AddMenuItem">
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
<arg name="menu_hints" type="a{sv}" direction="in"/>
<arg name="result" type="i" direction="out"/>
</method>
<method name="RemoveMenuItem">
<arg name="id" type="i" direction="in"/>
</method>
<method name="UpdateDockItem">
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
<arg name="hints" type="a{sv}" direction="in"/>
</method>
<property name="DesktopFile" type="s" access="read"/>
<property name="Uri" type="s" access="read"/>
<signal name="MenuItemActivated">
<arg name="id" type="i"/>
</signal>
</interface>
</node>

View file

@ -1,68 +0,0 @@
# Generate and add translations
# The LINGUAS variable can be used to limit that set
if(QT_LCONVERT_EXECUTABLE)
# get environment variable for translations
set(LINGUAS "$ENV{LINGUAS}")
string(REGEX REPLACE "[ \t]+" \; output "${LINGUAS}")
# Find more languages
# We support xx.po and xx_YY.po, and additionally translations for qt using qt_xx.po or qt_xx_YY.po
file(GLOB avail_pofiles *.po)
foreach(PO_FILE ${avail_pofiles})
get_filename_component(basename ${PO_FILE} NAME_WE)
# CMake can't use MATCH to get the second catch...
string(REGEX REPLACE "(qt_)?([a-zA-Z]+)(_.+)?$" "\\2" lang ${basename})
# test if we want this language
set(flg 1)
if(LINGUAS)
string(REGEX MATCH "${lang}" flg ${LINGUAS})
endif(LINGUAS)
if(flg)
generate_ts(QM ${basename})
generate_qm(QM ${basename})
list(APPEND qm_files ${QM})
list(APPEND gen_linguas ${lang})
endif(flg)
endforeach(PO_FILE ${avail_pofiles})
if(gen_linguas)
list(REMOVE_DUPLICATES gen_linguas)
endif(gen_linguas)
message(STATUS "Including languages: ${gen_linguas}")
else(QT_LCONVERT_EXECUTABLE)
message(STATUS "WARNING: lconvert not found, you won't have translations!")
endif(QT_LCONVERT_EXECUTABLE)
# For a static or win32 build, we need to include Qt translations if available
if(QT_TRANSLATIONS_DIR)
if(STATIC OR WIN32)
foreach(LANG ${gen_linguas})
file(GLOB lang_files ${QT_TRANSLATIONS_DIR}/qt_${LANG}*.qm)
foreach(absfile ${lang_files})
get_filename_component(filename ${absfile} NAME)
message(STATUS "Importing ${filename}")
configure_file(${absfile} ${CMAKE_CURRENT_BINARY_DIR}/${filename} COPYONLY)
list(APPEND qm_files ${CMAKE_CURRENT_BINARY_DIR}/${filename})
endforeach(absfile ${lang_files})
endforeach(LANG ${gen_linguas})
endif(STATIC OR WIN32)
endif(QT_TRANSLATIONS_DIR)
# Write resource file
set(resfile ${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc)
file(WRITE ${resfile} "<!DOCTYPE RCC><RCC version=\"1.0\">\n"
"<qresource prefix=\"/i18n\">\n")
foreach(file ${qm_files})
get_filename_component(file ${file} NAME)
file(APPEND ${resfile} " <file>${file}</file>\n")
endforeach(file ${qm_files})
file(APPEND ${resfile} "</qresource>\n</RCC>\n")
#add_custom_command(OUTPUT ${resfile} DEPENDS ${qm_files})
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${qm_files};i18n.qrc")
install(FILES ${qm_files} DESTINATION ${DATA_INSTALL_DIR}/quassel/translations)
add_custom_target(po DEPENDS ${qm_files})

View file

@ -1,35 +0,0 @@
cs
da
de
el
en_GB
en_US
eo
es
fi
fr
gl
hi
hu
it
ja
ko
lt
mr
nb
nl
oc
pa
pl
pt
pt_BR
ro
ru
sl
sq
sr
sv
tr
uk
zh_CN
zh_TW

View file

@ -1,36 +0,0 @@
In order to create or update a translatable file, run the following
command in the directory po/:
./update.sh xx
where xx is the two-letter language code according to ISO 639 (which,
if needed, may be suffixed by a country code according to ISO 3166).
Quassel will automatically load these translation files based on the
system locale. Examples for valid codes: de, en_US
You can open translation files with poedit for example and add/edit
translated strings.
The *.po files can and should be kept in sync with the source code by
running update.sh regularly (existing translations won't be removed).
NOTE: Remember to remove X-Virgin-Header line if you want to preserve
your header.
Qt itself does not use the *.po files, but a compact binary format
(*.qm). These files will automatically be generated at build time. By
default, all languages will be built. To select languages, use
environment variable LINGUAS to specify superset of languages you want
to build in. As you can see in example there we will build only Czech
German and French translations.
EXAMPLE:
$ export LINGUAS="cs de fr"
$ cmake /path/to/source
NOTE: You'll need lupdate, lconvert, lrelease installed with your Qt in
order to generate translation files. Some distributions don't
package that tool; in that case you won't get translations.
The .pot file can be regenerated with `./update-pot.sh`

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,14 +0,0 @@
diff --git b/po/quassel.pot a/po/quassel.pot
index dcfb526..d460562 100644
--- b/po/quassel.pot
+++ a/po/quassel.pot
@@ -5,2 +5,9 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
+"Project-Id-Version: Quassel IRC\n"
+"PO-Revision-Date: \n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"Language: en_US\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+"Report-Msgid-Bugs-To: http://bugs.quassel-irc.org/\n"
"X-Qt-Contexts: true\n"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,6 +0,0 @@
#!/bin/sh
lupdate ../src -ts quassel.ts && lconvert -i quassel.ts -o quassel.po \
&& msguniq -o quassel.pot quassel.po && rm quassel.ts quassel.po \
&& patch -Np2 < quassel.pot.patch \
&& sed -i -re 's/^msgstr\[0\] ""/msgstr[0] ""\nmsgstr[1] ""/;' quassel.pot

View file

@ -1,10 +0,0 @@
#!/usr/bin/env sh
if [ ! $# -eq 1 ]; then
exec >&2
echo "Usage: $0 <language>"
echo " language: two-letter language code + country code if applicable (de, en_GB)"
exit 1
fi
msgmerge --no-wrap --width 1 -U $1.po quassel.pot
[ $? -ne 0 ] && echo "Something went wrong"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -20,10 +20,9 @@ endif()
include_directories(${KDE4_INCLUDES})
add_executable(quassel WIN32 common/main.cpp qtui/monoapplication.cpp ${CLIENT_DEPS} ${CORE_DEPS} ${COMMON_DEPS})
qt4_use_modules(quassel Core Gui Network ${CLIENT_QT_MODULES} ${CORE_QT_MODULES})
add_dependencies(quassel po)
set_target_properties(quassel PROPERTIES
OUTPUT_NAME ../quassel)
target_link_libraries(quassel mod_qtui mod_uisupport mod_client mod_core mod_common ${COMMON_LIBRARIES} ${CLIENT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES} ${QT_QTMAIN_LIBRARY})
install(TARGETS quassel RUNTIME DESTINATION ${BIN_INSTALL_DIR})
add_executable(kuassel WIN32 common/main.cpp qtui/monoapplication.cpp ${CLIENT_DEPS} ${CORE_DEPS} ${COMMON_DEPS})
qt4_use_modules(kuassel Core Gui Network ${CLIENT_QT_MODULES} ${CORE_QT_MODULES})
set_target_properties(kuassel PROPERTIES
OUTPUT_NAME ../kuassel)
target_link_libraries(kuassel mod_qtui mod_uisupport mod_client mod_core mod_common ${COMMON_LIBRARIES} ${CLIENT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES} ${QT_QTMAIN_LIBRARY})
install(TARGETS kuassel RUNTIME DESTINATION ${BIN_INSTALL_DIR})

View file

@ -39,7 +39,7 @@ set(SOURCES
)
include_directories(${KDE4_INCLUDES})
add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS})
add_definitions(${KDE4_DEFINITIONS})
qt4_add_resources(SOURCES ${CLIENT_RCS})

View file

@ -283,7 +283,7 @@ void ClientAuthHandler::startRegistration()
useSsl = _account.useSsl();
#endif
_peer->dispatch(RegisterClient(Quassel::buildInfo().fancyVersionString, Quassel::buildInfo().buildDate, useSsl));
_peer->dispatch(RegisterClient(Quassel::buildInfo().plainVersionString, useSsl));
}

View file

@ -30,7 +30,7 @@
#include "client.h"
#include "quassel.h"
ClientSettings::ClientSettings(QString g) : Settings(g, Quassel::buildInfo().clientApplicationName)
ClientSettings::ClientSettings(QString g) : Settings(g, Quassel::buildInfo().applicationName)
{
}

View file

@ -51,42 +51,22 @@ if (QCA2_FOUND)
set(SOURCES ${SOURCES} keyevent.cpp)
endif()
if (ZLIB_FOUND)
add_definitions(-DHAVE_ZLIB)
include_directories(${ZLIB_INCLUDE_DIRS})
else()
set(SOURCES ${SOURCES} ../../3rdparty/miniz/miniz.c)
endif()
if (HAVE_SYSLOG)
add_definitions(-DHAVE_SYSLOG)
endif()
if(APPLE)
set(SOURCES ${SOURCES} mac_utils.cpp)
endif(APPLE)
if (WIN32)
set(SOURCES ${SOURCES} logbacktrace_win.cpp)
else()
if (EXECINFO_FOUND)
add_definitions(-DHAVE_EXECINFO)
include_directories(${EXECINFO_INCLUDES})
endif()
set(SOURCES ${SOURCES} logbacktrace_unix.cpp)
endif()
qt4_add_resources(SOURCES ${COMMON_RCS})
add_library(mod_common STATIC ${SOURCES})
qt4_use_modules(mod_common Core Network)
if(APPLE)
target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation")
endif(APPLE)
target_link_libraries(mod_common ${CMAKE_DL_LIBS} ${EXECINFO_LIBRARIES} ${ZLIB_LIBRARIES})
# This is needed so translations are generated before trying to build the qrc.
# Should probably find a nicer solution with proper dependencies between the involved files, though...
add_dependencies(mod_common po)

View file

@ -23,12 +23,7 @@
#include <QTcpSocket>
#include <QTimer>
#ifdef HAVE_ZLIB
#include <zlib.h>
#else
# define MINIZ_HEADER_FILE_ONLY
# include "../../3rdparty/miniz/miniz.c"
#endif
const int maxBufferSize = 64 * 1024 * 1024; // protect us from zip bombs
const int ioBufferSize = 64 * 1024; // chunk size for inflate/deflate; should not be too large as we preallocate that space!

View file

@ -25,11 +25,7 @@
class QTcpSocket;
#ifdef HAVE_ZLIB
typedef struct z_stream_s *z_streamp;
#else
typedef struct mz_stream_s *z_streamp;
#endif
class Compressor : public QObject
{

View file

@ -144,7 +144,7 @@ QString Identity::defaultNick()
QString Identity::defaultRealName()
{
QString generalDefault = tr("Quassel IRC User");
QString generalDefault = tr("Kuassel User");
#ifdef Q_OS_MAC
return CFStringToQString(CSCopyUserName(false));

View file

@ -1,227 +0,0 @@
/***************************************************************************
* Copyright (C) 2005-2014 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "quassel.h"
#include <windows.h>
#include <dbghelp.h>
#include <stdio.h>
// #include <QDebug>
#include <QFile>
#include <QTextStream>
void loadHelpStackFrame(IMAGEHLP_STACK_FRAME &ihsf, const STACKFRAME64 &stackFrame)
{
ZeroMemory(&ihsf, sizeof(IMAGEHLP_STACK_FRAME));
ihsf.InstructionOffset = stackFrame.AddrPC.Offset;
ihsf.FrameOffset = stackFrame.AddrFrame.Offset;
}
BOOL CALLBACK EnumSymbolsCB(PSYMBOL_INFO symInfo, ULONG size, PVOID user)
{
Q_UNUSED(size)
QStringList *params = (QStringList *)user;
if (symInfo->Flags & SYMFLAG_PARAMETER) {
params->append(symInfo->Name);
}
return TRUE;
}
struct EnumModulesContext {
HANDLE hProcess;
QTextStream &stream;
EnumModulesContext(HANDLE hProcess, QTextStream &stream) : hProcess(hProcess), stream(stream) {}
};
BOOL CALLBACK EnumModulesCB(LPCSTR ModuleName, DWORD64 BaseOfDll, PVOID UserContext)
{
Q_UNUSED(ModuleName)
IMAGEHLP_MODULE64 mod;
EnumModulesContext *context = (EnumModulesContext *)UserContext;
mod.SizeOfStruct = sizeof(IMAGEHLP_MODULE64);
if (SymGetModuleInfo64(context->hProcess, BaseOfDll, &mod)) {
QString line = QString("%1 0x%2 Image: %3").arg(mod.ModuleName, -14)
.arg(BaseOfDll, 8, 16, QLatin1Char('0'))
.arg(mod.LoadedImageName);
// qDebug() << qPrintable(line);
context->stream << line << '\n';
QString pdbName(mod.LoadedPdbName);
if (!pdbName.isEmpty()) {
QString line2 = QString("%1 %2").arg("", 32).arg(pdbName);
// qDebug() << qPrintable(line2);
context->stream << line2 << '\n';
}
}
return TRUE;
}
#if defined(_M_IX86) && defined(Q_CC_MSVC)
// Disable global optimization and ignore /GS waning caused by
// inline assembly.
// not needed with mingw cause we can tell mingw which registers we use
#pragma optimize("g", off)
#pragma warning(push)
#pragma warning(disable : 4748)
#endif
void Quassel::logBacktrace(const QString &filename)
{
DWORD MachineType;
CONTEXT Context;
STACKFRAME64 StackFrame;
#ifdef _M_IX86
ZeroMemory(&Context, sizeof(CONTEXT));
Context.ContextFlags = CONTEXT_CONTROL;
#ifdef __MINGW32__
asm ("Label:\n\t"
"movl %%ebp,%0;\n\t"
"movl %%esp,%1;\n\t"
"movl $Label,%%eax;\n\t"
"movl %%eax,%2;\n\t"
: "=r" (Context.Ebp), "=r" (Context.Esp), "=r" (Context.Eip)
: //no input
: "eax");
#else
_asm {
Label:
mov[Context.Ebp], ebp;
mov[Context.Esp], esp;
mov eax, [Label];
mov[Context.Eip], eax;
}
#endif
#else
RtlCaptureContext(&Context);
#endif
ZeroMemory(&StackFrame, sizeof(STACKFRAME64));
#ifdef _M_IX86
MachineType = IMAGE_FILE_MACHINE_I386;
StackFrame.AddrPC.Offset = Context.Eip;
StackFrame.AddrPC.Mode = AddrModeFlat;
StackFrame.AddrFrame.Offset = Context.Ebp;
StackFrame.AddrFrame.Mode = AddrModeFlat;
StackFrame.AddrStack.Offset = Context.Esp;
StackFrame.AddrStack.Mode = AddrModeFlat;
#elif defined(_M_X64)
MachineType = IMAGE_FILE_MACHINE_AMD64;
StackFrame.AddrPC.Offset = Context.Rip;
StackFrame.AddrPC.Mode = AddrModeFlat;
StackFrame.AddrFrame.Offset = Context.Rsp;
StackFrame.AddrFrame.Mode = AddrModeFlat;
StackFrame.AddrStack.Offset = Context.Rsp;
StackFrame.AddrStack.Mode = AddrModeFlat;
#elif defined(_M_IA64)
MachineType = IMAGE_FILE_MACHINE_IA64;
StackFrame.AddrPC.Offset = Context.StIIP;
StackFrame.AddrPC.Mode = AddrModeFlat;
StackFrame.AddrFrame.Offset = Context.IntSp;
StackFrame.AddrFrame.Mode = AddrModeFlat;
StackFrame.AddrBStore.Offset = Context.RsBSP;
StackFrame.AddrBStore.Mode = AddrModeFlat;
StackFrame.AddrStack.Offset = Context.IntSp;
StackFrame.AddrStack.Mode = AddrModeFlat;
#else
#error "Unsupported platform"
#endif
//EnterCriticalSection(&DbgHelpLock);
QFile logFile(filename);
logFile.open(QIODevice::Append);
QTextStream logStream(&logFile);
HANDLE hProcess = GetCurrentProcess();
HANDLE hThread = GetCurrentThread();
SymInitialize(hProcess, NULL, TRUE);
DWORD64 dwDisplacement;
ULONG64 buffer[(sizeof(SYMBOL_INFO) +
MAX_SYM_NAME*sizeof(TCHAR) +
sizeof(ULONG64) - 1) / sizeof(ULONG64)];
PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)buffer;
pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO);
pSymbol->MaxNameLen = MAX_SYM_NAME;
IMAGEHLP_MODULE64 mod;
mod.SizeOfStruct = sizeof(IMAGEHLP_MODULE64);
IMAGEHLP_STACK_FRAME ihsf;
ZeroMemory(&ihsf, sizeof(IMAGEHLP_STACK_FRAME));
int i = 0;
while (StackWalk64(MachineType, hProcess, hThread, &StackFrame, &Context, NULL, NULL, NULL, NULL)) {
if (i == 128)
break;
loadHelpStackFrame(ihsf, StackFrame);
if (StackFrame.AddrPC.Offset != 0) { // Valid frame.
QString fileName("???");
if (SymGetModuleInfo64(hProcess, ihsf.InstructionOffset, &mod)) {
fileName = QString(mod.ImageName);
int slashPos = fileName.lastIndexOf('\\');
if (slashPos != -1)
fileName = fileName.mid(slashPos + 1);
}
QString funcName;
if (SymFromAddr(hProcess, ihsf.InstructionOffset, &dwDisplacement, pSymbol)) {
funcName = QString(pSymbol->Name);
}
else {
funcName = QString("0x%1").arg(ihsf.InstructionOffset, 8, 16, QLatin1Char('0'));
}
QStringList params;
SymSetContext(hProcess, &ihsf, NULL);
SymEnumSymbols(hProcess, 0, NULL, EnumSymbolsCB, (PVOID)&params);
QString debugLine = QString("#%1 %2 0x%3 %4(%5)").arg(i, 3, 10)
.arg(fileName, -20)
.arg(ihsf.InstructionOffset, 8, 16, QLatin1Char('0'))
.arg(funcName)
.arg(params.join(", "));
// qDebug() << qPrintable(debugLine);
logStream << debugLine << '\n';
i++;
}
else {
break; // we're at the end.
}
}
// qDebug() << "List of linked Modules:";
logStream << "\n\nList of linked Modules:\n";
EnumModulesContext modulesContext(hProcess, logStream);
SymEnumerateModules64(hProcess, EnumModulesCB, (PVOID)&modulesContext);
logFile.close();
}
#if defined(_M_IX86) && defined(Q_CC_MSVC)
#pragma warning(pop)
#pragma optimize("g", on)
#endif

View file

@ -1,38 +0,0 @@
/***************************************************************************
* Copyright (C) 2005-2014 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "mac_utils.h"
#include <QVarLengthArray>
QString CFStringToQString(CFStringRef str)
{
if (!str)
return QString();
CFIndex length = CFStringGetLength(str);
const UniChar *chars = CFStringGetCharactersPtr(str);
if (chars)
return QString(reinterpret_cast<const QChar *>(chars), length);
QVarLengthArray<UniChar> buffer(length);
CFStringGetCharacters(str, CFRangeMake(0, length), buffer.data());
return QString(reinterpret_cast<const QChar *>(buffer.constData()), length);
}

View file

@ -1,29 +0,0 @@
/***************************************************************************
* Copyright (C) 2005-2014 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef MAC_UTILS_H
#define MAC_UTILS_H
#include <QString>
#include <CoreFoundation/CoreFoundation.h>
QString CFStringToQString(CFStringRef str);
#endif //MAC_UTILS_H

View file

@ -21,19 +21,9 @@
#include <cstdlib>
#include "monoapplication.h"
// We don't want quasselcore to depend on KDE
#include <KAboutData>
#include "kcmdlinewrapper.h"
#if !defined(BUILD_CORE) && defined(STATIC)
#include <QtPlugin>
Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)
#endif
#include "cliparser.h"
#include "quassel.h"
@ -41,13 +31,6 @@ int main(int argc, char **argv)
{
Quassel::setupBuildInfo();
QCoreApplication::setApplicationName(Quassel::buildInfo().applicationName);
QCoreApplication::setOrganizationName(Quassel::buildInfo().organizationName);
QCoreApplication::setOrganizationDomain(Quassel::buildInfo().organizationDomain);
// on OSX with Qt4, raster seems to fix performance issues
#if QT_VERSION < 0x050000 && defined Q_OS_MAC && !defined BUILD_CORE
QApplication::setGraphicsSystem("raster");
#endif
// We need to explicitly initialize the required resources when linking statically
Q_INIT_RESOURCE(sql);
@ -57,12 +40,139 @@ int main(int argc, char **argv)
// We need to init KCmdLineArgs first
// TODO: build an AboutData compat class to replace our aboutDlg strings
KAboutData aboutData("quassel", "kdelibs4", ki18n("Quassel IRC"), Quassel::buildInfo().plainVersionString.toUtf8(),
ki18n("A modern, distributed IRC client"));
aboutData.addLicense(KAboutData::License_GPL_V2);
KAboutData aboutData("kuassel", "kdelibs4", ki18n("Kuassel IRC"), Quassel::buildInfo().plainVersionString.toUtf8(),
ki18n("A modern, distributed IRC client"),
KAboutData::License_GPL_V2,
ki18n("(c) 2005-2014 Quassel Project\n"
"(c) 2014-2015 Katana Development Team"
));
// Quassel is dual license
aboutData.addLicense(KAboutData::License_GPL_V3);
aboutData.setBugAddress("http://bugs.quassel-irc.org/projects/quassel-irc/issues/new");
aboutData.setOrganizationDomain(Quassel::buildInfo().organizationDomain.toUtf8());
// that's just the core team
aboutData.addCredit( ki18n("Manuel Nickschas"), ki18n("Quassel project founder"), "sput@quassel-irc.org");
aboutData.addCredit( ki18n("Marcus Eggenberger"), ki18n("Quassel project motivator"), "egs@quassel-irc.org");
aboutData.addCredit( ki18n("Alexander von Renteln"), ki18n("Quassel windows maintainer"), "egs@quassel-irc.org");
// contributors...
aboutData.addCredit( ki18n("Daniel Albers"), ki18n("Master Of Translation, many fixes and enhancements"));
aboutData.addCredit( ki18n("Liudas Alisauskas"), ki18n("Lithuanian translation"));
aboutData.addCredit( ki18n("Terje Andersen"), ki18n("Norwegian translation, documentation"));
aboutData.addCredit( ki18n("Jens Arnold"), ki18n("Postgres migration fixes"));
aboutData.addCredit( ki18n("Adolfo Jayme Barrientos"), ki18n("Spanish translation"));
aboutData.addCredit( ki18n("Mattia Basaglia"), ki18n("Fixes"));
aboutData.addCredit( ki18n("Pete Beardmore"), ki18n("Linewrap for input line"));
aboutData.addCredit( ki18n("Rafael Belmonte"), ki18n("Spanish translation"));
aboutData.addCredit( ki18n("Sergiu Bivol"), ki18n("Romanian translation"));
aboutData.addCredit( ki18n("Bruno Brigras"), ki18n("Crash fixes"));
aboutData.addCredit( ki18n("Florent Castelli"), ki18n("Sanitize topic handling"));
aboutData.addCredit( ki18n("Theo Chatzimichos"), ki18n("Greek translation"));
aboutData.addCredit( ki18n("Yuri Chornoivan"), ki18n("Ukrainian translation"));
aboutData.addCredit( ki18n("Tomáš Chvátal"), ki18n("Czech translation"));
aboutData.addCredit( ki18n("\"Condex\""), ki18n("Galician translation"));
aboutData.addCredit( ki18n("Joshua Corbin"), ki18n("Various fixes"));
aboutData.addCredit( ki18n("\"cordata\""), ki18n("Esperanto translation"));
aboutData.addCredit( ki18n("Matthias Coy"), ki18n("German translation"));
aboutData.addCredit( ki18n("\"derpella\""), ki18n("Polish translation"));
aboutData.addCredit( ki18n("\"Dorian\""), ki18n("French translation"));
aboutData.addCredit( ki18n("Luke Faraone"), ki18n("Doc fixes"));
aboutData.addCredit( ki18n("Chris Fuenty"), ki18n("SASL support"));
aboutData.addCredit( ki18n("Kevin Funk"), ki18n("German translation"));
aboutData.addCredit( ki18n("Fabiano Francesconi"), ki18n("Italian translation"));
aboutData.addCredit( ki18n("Leo Franchi"), ki18n("OSX improvements"));
aboutData.addCredit( ki18n("Sebastien Fricker"), ki18n("Audio backend improvements"));
aboutData.addCredit( ki18n("Alf Gaida"), ki18n("Language improvements"));
aboutData.addCredit( ki18n("Aurélien Gâteau"), ki18n("Message Indicator support"));
aboutData.addCredit( ki18n("Marco Genise"), ki18n("Ideas, hacking, motivation"));
aboutData.addCredit( ki18n("Felix Geyer"), ki18n("Certificate handling improvements"));
aboutData.addCredit( ki18n("Volkan Gezer"), ki18n("Turkish translation"));
aboutData.addCredit( ki18n("Sjors Gielen"), ki18n("Fixes"));
aboutData.addCredit( ki18n("Sebastian Goth"), ki18n("Many improvements and features"));
aboutData.addCredit( ki18n("Michael Groh"), ki18n("German translation, fixes"));
aboutData.addCredit( ki18n("\"Gryllida\""), ki18n("IRC parser improvements"));
aboutData.addCredit( ki18n("H. İbrahim Güngör"), ki18n("Turkish translation"));
aboutData.addCredit( ki18n("Jiri Grönroos"), ki18n("Finnish translation"));
aboutData.addCredit( ki18n("Chris H"), ki18n("Various improvements"));
aboutData.addCredit( ki18n("Edward Hades"), ki18n("Russian translation"));
aboutData.addCredit( ki18n("John Hand"), ki18n("Former All-Seeing Eye logo"));
aboutData.addCredit( ki18n("Adam Harwood"), ki18n("ChatView improvements"));
aboutData.addCredit( ki18n("Jonas Heese"), ki18n("Project founder, various improvements"));
aboutData.addCredit( ki18n("Thomas Hogh"), ki18n("Windows builder"));
aboutData.addCredit( ki18n("Johannes Huber"), ki18n("Many fixes and features, bug triaging"));
aboutData.addCredit( ki18n("Theofilos Intzoglou"), ki18n("Greek translation"));
aboutData.addCredit( ki18n("Jovan Jojkić"), ki18n("Serbian translation"));
aboutData.addCredit( ki18n("Allan Jude"), ki18n("Documentation improvements"));
aboutData.addCredit( ki18n("Michael Kedzierski"), ki18n("Mac fixes"));
aboutData.addCredit( ki18n("Scott Kitterman<b></dt><dd>Kubuntu nightly packager, (packaging/build system) bughunter"));
aboutData.addCredit( ki18n("Paul Klumpp"), ki18n("Initial design and mainwindow layout"));
aboutData.addCredit( ki18n("Maia Kozheva"), ki18n("Russian translation"));
aboutData.addCredit( ki18n("Tae-Hoon Kwon"), ki18n("Korean translation"));
aboutData.addCredit( ki18n("\"Larso\""), ki18n("Finnish translation"));
aboutData.addCredit( ki18n("Patrick Lauer"), ki18n("Gentoo packaging"));
aboutData.addCredit( ki18n("Chris Le Sueur"), ki18n("Various fixes and improvements"));
aboutData.addCredit( ki18n("Jerome Leclanche"), ki18n("Context menu fixes"));
aboutData.addCredit( ki18n("Hendrik Leppkes"), ki18n("Various features"));
aboutData.addCredit( ki18n("Jason Lynch"), ki18n("Bugfixes"));
aboutData.addCredit( ki18n("Awad Mackie"), ki18n("ChatView improvements"));
aboutData.addCredit( ki18n("Michael Marley"), ki18n("Various fixes and improvements"));
aboutData.addCredit( ki18n("Martin Mayer"), ki18n("German translation"));
aboutData.addCredit( ki18n("Daniel Meltzer"), ki18n("Various fixes and improvements"));
aboutData.addCredit( ki18n("Sebastian Meyer"), ki18n("Fixes"));
aboutData.addCredit( ki18n("Daniel E. Moctezuma"), ki18n("Japanese translation"));
aboutData.addCredit( ki18n("Chris Moeller"), ki18n("Various fixes and improvements"));
aboutData.addCredit( ki18n("Thomas Müller"), ki18n("Fixes, Debian packaging"));
aboutData.addCredit( ki18n("Gábor Németh"), ki18n("Hungarian translation"));
aboutData.addCredit( ki18n("Per Nielsen"), ki18n("Danish translation"));
aboutData.addCredit( ki18n("J-P Nurmi"), ki18n("Fixes"));
aboutData.addCredit( ki18n("Marco Paolone"), ki18n("Italian translation"));
aboutData.addCredit( ki18n("Bas Pape"), ki18n("Many fixes and improvements, bug and patch triaging, tireless community support"));
aboutData.addCredit( ki18n("Bruno Patri"), ki18n("French translation"));
aboutData.addCredit( ki18n("Drew Patridge"), ki18n("BluesTheme stylesheet"));
aboutData.addCredit( ki18n("Celeste Paul"), ki18n("Usability Queen"));
aboutData.addCredit( ki18n("Vit Pelcak"), ki18n("Czech translation"));
aboutData.addCredit( ki18n("Regis Perrin"), ki18n("French translation"));
aboutData.addCredit( ki18n("Diego Petten&ograve;"), ki18n("Gentoo maintainer, build system improvements"));
aboutData.addCredit( ki18n("Simon Philips"), ki18n("Dutch translation"));
aboutData.addCredit( ki18n("Daniel Pielmeier"), ki18n("Gentoo maintainer"));
aboutData.addCredit( ki18n("Nuno Pinheiro"), ki18n("Tons of Oxygen icons including our application icon"));
aboutData.addCredit( ki18n("David Planella"), ki18n("Translation system fixes"));
aboutData.addCredit( ki18n("Jure Repinc"), ki18n("Slovenian translation"));
aboutData.addCredit( ki18n("Patrick von Reth"), ki18n("MinGW support, SNORE backend, Windows packager"));
aboutData.addCredit( ki18n("Dirk Rettschlag"), ki18n("Various fixes and new features"));
aboutData.addCredit( ki18n("Miguel Revilla"), ki18n("Spanish translation"));
aboutData.addCredit( ki18n("Jaak Ristioja"), ki18n("Fixes"));
aboutData.addCredit( ki18n("David Roden"), ki18n("Fixes"));
aboutData.addCredit( ki18n("Henning Rohlfs"), ki18n("Various fixes"));
aboutData.addCredit( ki18n("Stella Rouzi"), ki18n("Greek translation"));
aboutData.addCredit( ki18n("\"salnx\""), ki18n("Highlight configuration improvements"));
aboutData.addCredit( ki18n("Martin Sandsmark"), ki18n("Core fixes, Quasseldroid"));
aboutData.addCredit( ki18n("David Sansome"), ki18n("OSX Notification Center support"));
aboutData.addCredit( ki18n("Dennis Schridde"), ki18n("D-Bus notifications"));
aboutData.addCredit( ki18n("Jussi Schultink"), ki18n("Tireless tester, {ku|U}buntu tester and lobbyist, liters of delicious Finnish alcohol"));
aboutData.addCredit( ki18n("Tim Schumacher"), ki18n("Fixes and feedback"));
aboutData.addCredit( ki18n("\"sfionov\""), ki18n("Russian translation"));
aboutData.addCredit( ki18n("Harald Sitter"), ki18n("{ku|U}buntu packager, motivator, promoter"));
aboutData.addCredit( ki18n("Ramanathan Sivagurunathan"), ki18n("Fixes"));
aboutData.addCredit( ki18n("Stefanos Sofroniou"), ki18n("Greek translation"));
aboutData.addCredit( ki18n("Rüdiger Sonderfeld"), ki18n("Emacs keybindings"));
aboutData.addCredit( ki18n("Alexander Stein"), ki18n("Tray icon fix"));
aboutData.addCredit( ki18n("Daniel Steinmetz"), ki18n("Early beta tester and bughunter (on Vista&trade;!)"));
aboutData.addCredit( ki18n("Jesper Thomschütz"), ki18n("Various fixes"));
aboutData.addCredit( ki18n("Arthur Titeica"), ki18n("Romanian translation"));
aboutData.addCredit( ki18n("\"ToBeFree\""), ki18n("German translation"));
aboutData.addCredit( ki18n("Edward Toroshchin"), ki18n("Russian translation"));
aboutData.addCredit( ki18n("Adam Tulinius"), ki18n("Early beta tester and bughunter, Danish translation"));
aboutData.addCredit( ki18n("Deniz Türkoglu"), ki18n("Mac fixes"));
aboutData.addCredit( ki18n("Frederik M.J. Vestre"), ki18n("Norwegian translation"));
aboutData.addCredit( ki18n("Atte Virtanen"), ki18n("Finnish translation"));
aboutData.addCredit( ki18n("Pavel Volkovitskiy"), ki18n("Early beta tester and bughunter"));
aboutData.addCredit( ki18n("Roscoe van Wyk"), ki18n("Fixes"));
aboutData.addCredit( ki18n(""), ki18n("Portuguese translation"));
aboutData.addCredit( ki18n("Benjamin Zeller"), ki18n("Windows build system fixes"));
aboutData.addCredit( ki18n("\"zeugma\""), ki18n("Turkish translation"));
// and finally special thanks to...
aboutData.addCredit( ki18n("John Hand"), ki18n("the original Quassel icon - The All-Seeing Eye"));
aboutData.addCredit( ki18n("Qt Software formerly known as Trolltech"), ki18n("creating Qt and Qtopia, and for sponsoring development of QuasselTopia with Greenphones and more"));
KCmdLineArgs::init(argc, argv, &aboutData);
cliParser = new KCmdLineWrapper();
@ -79,7 +189,6 @@ int main(int argc, char **argv)
cliParser->addOption("datadir <path>", 0, "DEPRECATED - Use --configdir instead");
// put client-only arguments here
cliParser->addOption("icontheme <theme>", 0, "Override the system icon theme ('oxygen' is recommended)");
cliParser->addOption("qss <file.qss>", 0, "Load a custom application stylesheet");
cliParser->addSwitch("debugbufferswitches", 0, "Enables debugging for bufferswitches");
cliParser->addSwitch("debugmodel", 0, "Enables debugging for models");
@ -103,6 +212,9 @@ int main(int argc, char **argv)
#endif
cliParser->addSwitch("enable-experimental-dcc", 0, "Enable highly experimental and unfinished support for CTCP DCC (DANGEROUS)");
// service arguments
cliParser->addOption("url <url>", 0, "irc:// URL or server hostname");
// the KDE version needs this extra call to parse argc/argv before app is instantiated
if (!cliParser->init()) {
cliParser->usage();

View file

@ -56,13 +56,11 @@ struct HandshakeMessage {
struct RegisterClient : public HandshakeMessage
{
inline RegisterClient(const QString &clientVersion, const QString &buildDate, bool sslSupported = false)
inline RegisterClient(const QString &clientVersion, bool sslSupported = false)
: clientVersion(clientVersion)
, buildDate(buildDate)
, sslSupported(sslSupported) {}
QString clientVersion;
QString buildDate;
// this is only used by the LegacyProtocol in compat mode
bool sslSupported;

View file

@ -116,7 +116,7 @@ void DataStreamPeer::handleHandshakeMessage(const QVariantList &mapData)
}
if (msgType == "ClientInit") {
handle(RegisterClient(m["ClientVersion"].toString(), m["ClientDate"].toString(), false)); // UseSsl obsolete
handle(RegisterClient(m["ClientVersion"].toString(), false)); // UseSsl obsolete
}
else if (msgType == "ClientInitReject") {
@ -167,7 +167,6 @@ void DataStreamPeer::dispatch(const RegisterClient &msg) {
QVariantMap m;
m["MsgType"] = "ClientInit";
m["ClientVersion"] = msg.clientVersion;
m["ClientDate"] = msg.buildDate;
writeMessage(m);
}

View file

@ -151,7 +151,7 @@ void LegacyPeer::handleHandshakeMessage(const QVariant &msg)
socket()->setProperty("UseCompression", true);
}
#endif
handle(RegisterClient(m["ClientVersion"].toString(), m["ClientDate"].toString(), m["UseSsl"].toBool()));
handle(RegisterClient(m["ClientVersion"].toString(), m["UseSsl"].toBool()));
}
else if (msgType == "ClientInitReject") {
@ -213,7 +213,6 @@ void LegacyPeer::dispatch(const RegisterClient &msg) {
QVariantMap m;
m["MsgType"] = "ClientInit";
m["ClientVersion"] = msg.clientVersion;
m["ClientDate"] = msg.buildDate;
// FIXME only in compat mode
m["ProtocolVersion"] = protocolVersion;

View file

@ -22,11 +22,9 @@
#include <iostream>
#include <signal.h>
#if !defined Q_OS_WIN && !defined Q_OS_MAC
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#endif
#include <QCoreApplication>
#include <QDateTime>
@ -37,6 +35,8 @@
#include <QTranslator>
#include <QUuid>
#include <kstandarddirs.h>
#include "bufferinfo.h"
#include "identity.h"
#include "logger.h"
@ -91,28 +91,23 @@ bool Quassel::init()
if (_handleCrashes) {
// we have crashhandler for win32 and unix (based on execinfo).
#if defined(Q_OS_WIN) || defined(HAVE_EXECINFO)
# ifndef Q_OS_WIN
#if defined(HAVE_EXECINFO)
// we only handle crashes ourselves if coredumps are disabled
struct rlimit *limit = (rlimit *)malloc(sizeof(struct rlimit));
int rc = getrlimit(RLIMIT_CORE, limit);
if (rc == -1 || !((long)limit->rlim_cur > 0 || limit->rlim_cur == RLIM_INFINITY)) {
# endif /* Q_OS_WIN */
signal(SIGABRT, handleSignal);
signal(SIGSEGV, handleSignal);
# ifndef Q_OS_WIN
signal(SIGBUS, handleSignal);
}
free(limit);
# endif /* Q_OS_WIN */
#endif /* Q_OS_WIN || HAVE_EXECINFO */
#endif /* HAVE_EXECINFO */
}
_initialized = true;
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
setupEnvironment();
registerMetaTypes();
Network::setDefaultCodecForServer("ISO-8859-1");
@ -125,7 +120,7 @@ bool Quassel::init()
}
if (isOptionSet("version")) {
std::cout << qPrintable("Quassel IRC: " + Quassel::buildInfo().plainVersionString) << std::endl;
std::cout << qPrintable("Kuassel IRC: " + Quassel::buildInfo().plainVersionString) << std::endl;
return false;
}
@ -211,97 +206,11 @@ void Quassel::registerMetaTypes()
}
}
void Quassel::setupEnvironment()
{
// On modern Linux systems, XDG_DATA_DIRS contains a list of directories containing application data. This
// is, for example, used by Qt for finding icons and other things. In case Quassel is installed in a non-standard
// prefix (or run from the build directory), it makes sense to add this to XDG_DATA_DIRS so we don't have to
// hack extra search paths into various places.
#ifdef Q_OS_UNIX
QString xdgDataVar = QFile::decodeName(qgetenv("XDG_DATA_DIRS"));
if (xdgDataVar.isEmpty())
xdgDataVar = QLatin1String("/usr/local/share:/usr/share"); // sane defaults
QStringList xdgDirs = xdgDataVar.split(QLatin1Char(':'), QString::SkipEmptyParts);
// Add our install prefix (if we're not in a bindir, this just adds the current workdir)
QString appDir = QCoreApplication::applicationDirPath();
int binpos = appDir.lastIndexOf("/bin");
if (binpos >= 0) {
appDir.replace(binpos, 4, "/share");
xdgDirs.append(appDir);
// Also append apps/quassel, this is only for QIconLoader to find icons there
xdgDirs.append(appDir + "/apps/quassel");
} else
xdgDirs.append(appDir); // build directory is always the last fallback
xdgDirs.removeDuplicates();
qputenv("XDG_DATA_DIRS", QFile::encodeName(xdgDirs.join(":")));
#endif
}
void Quassel::setupBuildInfo()
{
_buildInfo.applicationName = "quassel";
_buildInfo.coreApplicationName = "quasselcore";
_buildInfo.clientApplicationName = "quasselclient";
_buildInfo.organizationName = "Quassel Project";
_buildInfo.organizationDomain = "quassel-irc.org";
_buildInfo.protocolVersion = 10; // FIXME: deprecated, will be removed
_buildInfo.applicationName = "kuassel";
_buildInfo.baseVersion = QUASSEL_VERSION_STRING;
_buildInfo.generatedVersion = GIT_DESCRIBE;
// This will be imprecise for incremental builds not touching this file, but we really don't want to always recompile
_buildInfo.buildDate = QString("%1 %2").arg(__DATE__, __TIME__);
// Check if we got a commit hash
if (!QString(GIT_HEAD).isEmpty())
_buildInfo.commitHash = GIT_HEAD;
else if (!QString(DIST_HASH).contains("Format")) {
_buildInfo.commitHash = DIST_HASH;
_buildInfo.commitDate = QString(DIST_DATE).toUInt();
}
// create a nice version string
if (_buildInfo.generatedVersion.isEmpty()) {
if (!_buildInfo.commitHash.isEmpty()) {
// dist version
_buildInfo.plainVersionString = QString("v%1 (dist-%2)")
.arg(_buildInfo.baseVersion)
.arg(_buildInfo.commitHash.left(7));
_buildInfo.fancyVersionString = QString("v%1 (dist-<a href=\"http://git.quassel-irc.org/?p=quassel.git;a=commit;h=%3\">%2</a>)")
.arg(_buildInfo.baseVersion)
.arg(_buildInfo.commitHash.left(7))
.arg(_buildInfo.commitHash);
}
else {
// we only have a base version :(
_buildInfo.plainVersionString = QString("v%1 (unknown revision)").arg(_buildInfo.baseVersion);
}
}
else {
// analyze what we got from git-describe
QRegExp rx("(.*)-(\\d+)-g([0-9a-f]+)(-dirty)?$");
if (rx.exactMatch(_buildInfo.generatedVersion)) {
QString distance = rx.cap(2) == "0" ? QString() : QString("%1+%2 ").arg(rx.cap(1), rx.cap(2));
_buildInfo.plainVersionString = QString("v%1 (%2git-%3%4)")
.arg(_buildInfo.baseVersion, distance, rx.cap(3), rx.cap(4));
if (!_buildInfo.commitHash.isEmpty()) {
_buildInfo.fancyVersionString = QString("v%1 (%2git-<a href=\"http://git.quassel-irc.org/?p=quassel.git;a=commit;h=%5\">%3</a>%4)")
.arg(_buildInfo.baseVersion, distance, rx.cap(3), rx.cap(4), _buildInfo.commitHash);
}
}
else {
_buildInfo.plainVersionString = QString("v%1 (invalid revision)").arg(_buildInfo.baseVersion);
}
}
if (_buildInfo.fancyVersionString.isEmpty())
_buildInfo.fancyVersionString = _buildInfo.plainVersionString;
_buildInfo.plainVersionString = QString("v%1").arg(_buildInfo.baseVersion);
}
@ -319,9 +228,7 @@ void Quassel::handleSignal(int sig)
break;
case SIGABRT:
case SIGSEGV:
#ifndef Q_OS_WIN
case SIGBUS:
#endif
logBacktrace(coreDumpFileName());
exit(EXIT_FAILURE);
break;
@ -333,9 +240,6 @@ void Quassel::handleSignal(int sig)
void Quassel::logFatalMessage(const char *msg)
{
#ifdef Q_OS_MAC
Q_UNUSED(msg)
#else
QFile dumpFile(coreDumpFileName());
dumpFile.open(QIODevice::Append);
QTextStream dumpStream(&dumpFile);
@ -343,7 +247,6 @@ void Quassel::logFatalMessage(const char *msg)
dumpStream << "Fatal: " << msg << '\n';
dumpStream.flush();
dumpFile.close();
#endif
}
@ -365,8 +268,8 @@ const QString &Quassel::coreDumpFileName()
QFile dumpFile(_coreDumpFileName);
dumpFile.open(QIODevice::Append);
QTextStream dumpStream(&dumpFile);
dumpStream << "Quassel IRC: " << _buildInfo.baseVersion << ' ' << _buildInfo.commitHash << '\n';
qDebug() << "Quassel IRC: " << _buildInfo.baseVersion << ' ' << _buildInfo.commitHash;
dumpStream << "Kuassel IRC: " << _buildInfo.baseVersion << '\n';
qDebug() << "Kuassel IRC: " << _buildInfo.baseVersion;
dumpStream.flush();
dumpFile.close();
}
@ -379,38 +282,12 @@ QString Quassel::configDirPath()
if (!_configDirPath.isEmpty())
return _configDirPath;
if (Quassel::isOptionSet("datadir")) {
qWarning() << "Obsolete option --datadir used!";
_configDirPath = Quassel::optionValue("datadir");
}
else if (Quassel::isOptionSet("configdir")) {
_configDirPath = Quassel::optionValue("configdir");
}
else {
#ifdef Q_OS_MAC
// On Mac, the path is always the same
_configDirPath = QDir::homePath() + "/Library/Application Support/Quassel/";
#else
// We abuse QSettings to find us a sensible path on the other platforms
# ifdef Q_OS_WIN
// don't use the registry
QSettings::Format format = QSettings::IniFormat;
# else
QSettings::Format format = QSettings::NativeFormat;
# endif
QSettings s(format, QSettings::UserScope, QCoreApplication::organizationDomain(), buildInfo().applicationName);
QFileInfo fileInfo(s.fileName());
_configDirPath = fileInfo.dir().absolutePath();
#endif /* Q_OS_MAC */
}
if (!_configDirPath.endsWith(QDir::separator()) && !_configDirPath.endsWith('/'))
_configDirPath += QDir::separator();
_configDirPath = KStandardDirs().localkdedir() + QDir::separator() + buildInfo().applicationName + QDir::separator();
QDir qDir(_configDirPath);
if (!qDir.exists(_configDirPath)) {
if (!qDir.mkpath(_configDirPath)) {
qCritical() << "Unable to create Quassel config directory:" << qPrintable(qDir.absolutePath());
qCritical() << "Unable to create config directory:" << qPrintable(qDir.absolutePath());
return QString();
}
}
@ -421,71 +298,15 @@ QString Quassel::configDirPath()
QStringList Quassel::dataDirPaths()
{
if (_dataDirPaths.isEmpty()) {
_dataDirPaths = KStandardDirs().resourceDirs("data");
}
return _dataDirPaths;
}
QStringList Quassel::findDataDirPaths() const
{
QStringList dataDirNames = QString(qgetenv("XDG_DATA_DIRS")).split(':', QString::SkipEmptyParts);
if (!dataDirNames.isEmpty()) {
for (int i = 0; i < dataDirNames.count(); i++)
dataDirNames[i].append("/apps/quassel/");
}
else {
// Provide a fallback
#ifdef Q_OS_WIN
dataDirNames << qgetenv("APPDATA") + QCoreApplication::organizationDomain() + "/share/apps/quassel/"
<< qgetenv("APPDATA") + QCoreApplication::organizationDomain()
<< QCoreApplication::applicationDirPath();
}
#elif defined Q_OS_MAC
dataDirNames << QDir::homePath() + "/Library/Application Support/Quassel/"
<< QCoreApplication::applicationDirPath();
}
#else
dataDirNames.append("/usr/share/apps/quassel/");
}
// on UNIX, we always check our install prefix
QString appDir = QCoreApplication::applicationDirPath();
int binpos = appDir.lastIndexOf("/bin");
if (binpos >= 0) {
appDir.replace(binpos, 4, "/share");
appDir.append("/apps/quassel/");
if (!dataDirNames.contains(appDir))
dataDirNames.append(appDir);
}
#endif
// add resource path and workdir just in case
dataDirNames << QCoreApplication::applicationDirPath() + "/data/"
<< ":/data/";
// append trailing '/' and check for existence
QStringList::Iterator iter = dataDirNames.begin();
while (iter != dataDirNames.end()) {
if (!iter->endsWith(QDir::separator()) && !iter->endsWith('/'))
iter->append(QDir::separator());
if (!QFile::exists(*iter))
iter = dataDirNames.erase(iter);
else
++iter;
}
return dataDirNames;
}
QString Quassel::findDataFilePath(const QString &fileName)
{
QStringList dataDirs = dataDirPaths();
foreach(QString dataDir, dataDirs) {
QString path = dataDir + fileName;
if (QFile::exists(path))
return path;
}
return QString();
return KStandardDirs().locate("data", buildInfo().applicationName + QDir::separator() + fileName);
}

View file

@ -41,22 +41,9 @@ public:
};
struct BuildInfo {
QString fancyVersionString; // clickable rev
QString plainVersionString; // no <a> tag
QString baseVersion;
QString generatedVersion;
QString commitHash;
uint commitDate;
QString buildDate;
uint protocolVersion; // deprecated
QString applicationName;
QString coreApplicationName;
QString clientApplicationName;
QString organizationName;
QString organizationDomain;
QString plainVersionString; // no <a> tag
};
//! A list of features that are optional in core and/or client, but need runtime checking
@ -144,11 +131,9 @@ protected:
inline void setRunMode(RunMode mode);
inline void setDataDirPaths(const QStringList &paths);
QStringList findDataDirPaths() const;
inline void disableCrashhandler();
private:
void setupEnvironment();
void registerMetaTypes();
static void handleSignal(int signal);

View file

@ -452,10 +452,9 @@ bool Core::startListening()
case QAbstractSocket::IPv6Protocol:
if (_v6server.listen(addr, port)) {
quInfo() << qPrintable(
tr("Listening for GUI clients on IPv6 %1 port %2 using protocol version %3")
tr("Listening for GUI clients on IPv6 %1 port %2")
.arg(addr.toString())
.arg(_v6server.serverPort())
.arg(Quassel::buildInfo().protocolVersion)
);
success = true;
}
@ -469,10 +468,9 @@ bool Core::startListening()
case QAbstractSocket::IPv4Protocol:
if (_server.listen(addr, port)) {
quInfo() << qPrintable(
tr("Listening for GUI clients on IPv4 %1 port %2 using protocol version %3")
tr("Listening for GUI clients on IPv4 %1 port %2")
.arg(addr.toString())
.arg(_server.serverPort())
.arg(Quassel::buildInfo().protocolVersion)
);
success = true;
}

View file

@ -174,9 +174,7 @@ void CoreAuthHandler::handle(const RegisterClient &msg)
int uphours = uptime / 3600; uptime %= 3600;
int upmins = uptime / 60;
QString coreInfo = tr("<b>Quassel Core Version %1</b><br>"
"Built: %2<br>"
"Up %3d%4h%5m (since %6)").arg(Quassel::buildInfo().fancyVersionString)
.arg(Quassel::buildInfo().buildDate)
"Up %3d%4h%5m (since %6)").arg(Quassel::buildInfo().baseVersion)
.arg(updays).arg(uphours, 2, 10, QChar('0')).arg(upmins, 2, 10, QChar('0')).arg(Core::instance()->startTime().toString(Qt::TextDate));
// useSsl and coreInfo are only used for the legacy protocol

View file

@ -36,8 +36,7 @@ CoreCoreInfo::CoreCoreInfo(CoreSession *parent)
QVariantMap CoreCoreInfo::coreData() const
{
QVariantMap data;
data["quasselVersion"] = Quassel::buildInfo().fancyVersionString;
data["quasselBuildDate"] = Quassel::buildInfo().buildDate;
data["quasselVersion"] = Quassel::buildInfo().baseVersion;
data["startTime"] = Core::instance()->startTime();
data["sessionConnectedClients"] = _coreSession->signalProxy()->peerCount();
return data;

View file

@ -478,7 +478,7 @@ void CoreNetwork::socketInitialized()
}
QString nick;
if (identity->nicks().isEmpty()) {
nick = "quassel";
nick = "kuassel";
qWarning() << "CoreNetwork::socketInitialized(): no nicks supplied for identity Id" << identity->id();
}
else {

View file

@ -1088,6 +1088,6 @@ void CoreSessionEventProcessor::handleCtcpTime(CtcpEvent *e)
void CoreSessionEventProcessor::handleCtcpVersion(CtcpEvent *e)
{
e->setReply(QString("Quassel IRC %1 (built on %2) -- http://www.quassel-irc.org")
.arg(Quassel::buildInfo().plainVersionString).arg(Quassel::buildInfo().buildDate));
e->setReply(QString("Kuassel IRC %1")
.arg(Quassel::buildInfo().baseVersion));
}

View file

@ -22,7 +22,7 @@
#include "quassel.h"
CoreSettings::CoreSettings(const QString group) : Settings(group, Quassel::buildInfo().coreApplicationName)
CoreSettings::CoreSettings(const QString group) : Settings(group, Quassel::buildInfo().applicationName)
{
}

View file

@ -1,7 +1,6 @@
# Builds the qtui module
set(SOURCES
aboutdlg.cpp
awaylogfilter.cpp
awaylogview.cpp
bufferwidget.cpp
@ -49,11 +48,9 @@ set(SOURCES
titlesetter.cpp
topicwidget.cpp
verticaldock.cpp
webpreviewitem.cpp
)
set(FORMS
aboutdlg.ui
bufferviewwidget.ui
bufferwidget.ui
channellistdlg.ui
@ -81,19 +78,11 @@ set(FORMS
set(LIBS )
set(QT_MODULES )
add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS})
add_definitions(${KDE4_DEFINITIONS})
include_directories(${KDE4_INCLUDES})
list(APPEND SOURCES knotificationbackend.cpp)
list(APPEND LIBS ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBRARY} ${KDE4_KNOTIFYCONFIG_LIBRARY})
if (PHONON_FOUND OR Phonon4Qt5_FOUND)
add_definitions(-DHAVE_PHONON)
include_directories(${PHONON_INCLUDES})
set(SOURCES ${SOURCES} phononnotificationbackend.cpp)
set(FORMS ${FORMS} phononnotificationconfigwidget.ui)
list(APPEND LIBS ${PHONON_LIBS}) # PHONON_LIBRARIES only exists in config mode, it's not set by the legacy FindPhonon.cmake
endif()
if (QT_QTDBUS_FOUND)
add_definitions(-DHAVE_DBUS)
list(APPEND QT_MODULES DBus)
@ -103,17 +92,12 @@ if (QT_QTDBUS_FOUND)
list(APPEND LIBS dbusmenu-qt)
endif()
list(APPEND SOURCES statusnotifieritem.cpp statusnotifieritemdbus.cpp dockmanagernotificationbackend.cpp)
list(APPEND SOURCES statusnotifieritem.cpp statusnotifieritemdbus.cpp)
qt4_add_dbus_interface(SOURCES ../../interfaces/org.kde.StatusNotifierWatcher.xml statusnotifierwatcher)
qt4_add_dbus_interface(SOURCES ../../interfaces/org.freedesktop.Notifications.xml notificationsclient)
qt4_add_dbus_adaptor (SOURCES ../../interfaces/org.kde.StatusNotifierItem.xml statusnotifieritemdbus.h StatusNotifierItemDBus)
endif()
if (QT_QTWEBKIT_FOUND)
add_definitions(-DHAVE_WEBKIT)
list(APPEND QT_MODULES WebKit)
endif()
if(HAVE_SSL)
set(SOURCES ${SOURCES} sslinfodlg.cpp)
set(FORMS ${FORMS} sslinfodlg.ui)

View file

@ -1,224 +0,0 @@
/***************************************************************************
* Copyright (C) 2005-2014 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <QDateTime>
#include <QIcon>
#include "aboutdlg.h"
#include "quassel.h"
AboutDlg::AboutDlg(QWidget *parent) : QDialog(parent)
{
ui.setupUi(this);
ui.quasselLogo->setPixmap(QIcon(":/icons/quassel-64.png").pixmap(64)); // don't let the icon theme affect our logo here
ui.versionLabel->setText(QString(tr("<b>Version:</b> %1<br><b>Protocol version:</b> %2<br><b>Built:</b> %3"))
.arg(Quassel::buildInfo().fancyVersionString)
.arg(Quassel::buildInfo().protocolVersion)
.arg(Quassel::buildInfo().buildDate));
ui.aboutTextBrowser->setHtml(about());
ui.authorTextBrowser->setHtml(authors());
ui.contributorTextBrowser->setHtml(contributors());
ui.thanksToTextBrowser->setHtml(thanksTo());
setWindowIcon(QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png")));
}
QString AboutDlg::about() const
{
QString res;
res = tr("<b>A modern, distributed IRC Client</b><br><br>"
"&copy;%1 by the Quassel Project<br>"
"<a href=\"http://quassel-irc.org\">http://quassel-irc.org</a><br>"
"<a href=\"irc://irc.freenode.net/quassel\">#quassel</a> on <a href=\"http://www.freenode.net\">Freenode</a><br><br>"
"Quassel IRC is dual-licensed under <a href=\"http://www.gnu.org/licenses/gpl-2.0.txt\">GPLv2</a> and "
"<a href=\"http://www.gnu.org/licenses/gpl-3.0.txt\">GPLv3</a>.<br>"
"Most icons are &copy; by the <a href=\"http://www.oxygen-icons.org\">Oxygen Team</a> and used under the "
"<a href=\"http://www.gnu.org/licenses/lgpl.html\">LGPL</a>.<br><br>"
"Please use <a href=\"http://bugs.quassel-irc.org\">http://bugs.quassel-irc.org</a> to report bugs."
).arg("2005-2014");
return res;
}
QString AboutDlg::authors() const
{
QString res;
res = tr("Quassel IRC is mainly developed by:") +
"<dl>"
"<dt><b>Manuel \"Sputnick\" Nickschas</b></dt><dd><a href=\"mailto:sput@quassel-irc.org\">sput@quassel-irc.org</a><br>"
"Project Founder, Lead Developer</dd>"
"<dt><b>Marcus \"EgS\" Eggenberger</b></dt><dd><a href=\"mailto:egs@quassel-irc.org\">egs@quassel-irc.org</a><br>"
"Project Motivator, Lead Developer, Mac Maintainer</dd>"
"<dt><b>Alexander \"phon\" von Renteln</b></dt><dd><a href=\"mailto:phon@quassel-irc.org\">phon@quassel-irc.org</a><br>"
"Developer, Windows Maintainer</dd>"
"</dl>";
return res;
}
QString AboutDlg::contributors() const
{
QString res;
res = tr("We would like to thank the following contributors (in alphabetical order) and everybody we forgot to mention here:")
+ QString::fromUtf8("<br>"
"<dl>"
"<dt><b>Daniel \"al\" Albers</b></dt><dd>Master Of Translation, many fixes and enhancements</dd>"
"<dt><b>Liudas Alisauskas</b></dt><dd>Lithuanian translation</dd>"
"<dt><b>Terje \"tan\" Andersen</b></dt><dd>Norwegian translation, documentation</dd>"
"<dt><b>Jens \"amiconn\" Arnold</b></dt><dd>Postgres migration fixes</dd>"
"<dt><b>Adolfo Jayme Barrientos</b></dt><dd>Spanish translation</dd>"
"<dt><b>Mattia Basaglia</b></dt><dd>Fixes</dd>"
"<dt><b>Pete \"elbeardmorez\" Beardmore</b></dt><dd>Linewrap for input line</dd>"
"<dt><b>Rafael \"EagleScreen\" Belmonte</b></dt><dd>Spanish translation</dd>"
"<dt><b>Sergiu Bivol</b></dt><dd>Romanian translation</dd>"
"<dt><b>Bruno Brigras</b></dt><dd>Crash fixes</dd>"
"<dt><b>Florent Castelli</b></dt><dd>Sanitize topic handling</dd>"
"<dt><b>Theo \"tampakrap\" Chatzimichos</b></dt><dd>Greek translation</dd>"
"<dt><b>Yuri Chornoivan</b></dt><dd>Ukrainian translation</dd>"
"<dt><b>Tomáš \"scarabeus\" Chvátal</b></dt><dd>Czech translation</dd>"
"<dt><b>\"Condex\"</b></dt><dd>Galician translation</dd>"
"<dt><b>Joshua \"tvakah\" Corbin</b></dt><dd>Various fixes</dd>"
"<dt><b>\"cordata\"</b></dt><dd>Esperanto translation</dd>"
"<dt><b>Matthias \"pennywise\" Coy</b></dt><dd>German translation</dd>"
"<dt><b>\"derpella\"</b></dt><dd>Polish translation</dd>"
"<dt><b>\"Dorian\"</b></dt><dd>French translation</dd>"
"<dt><b>Luke Faraone</b></dt><dd>Doc fixes</dd>"
"<dt><b>Chris \"stitch\" Fuenty</b></dt><dd>SASL support</dd>"
"<dt><b>Kevin \"KRF\" Funk</b></dt><dd>German translation</dd>"
"<dt><b>Fabiano \"elbryan\" Francesconi</b></dt><dd>Italian translation</dd>"
"<dt><b>Leo Franchi</b></dt><dd>OSX improvements</dd>"
"<dt><b>Sebastien Fricker</b></dt><dd>Audio backend improvements</dd>"
"<dt><b>Alf Gaida</b></dt><dd>Language improvements</dd>"
"<dt><b>Aurélien \"agateau\" Gâteau</b></dt><dd>Message Indicator support</dd>"
"<dt><b>Marco \"kaffeedoktor\" Genise</b></dt><dd>Ideas, hacking, motivation</dd>"
"<dt><b>Felix \"debfx\" Geyer</b></dt><dd>Certificate handling improvements</dd>"
"<dt><b>Volkan Gezer</b></dt><dd>Turkish translation</dd>"
"<dt><b>Sjors \"dazjorz\" Gielen</b></dt><dd>Fixes</dd>"
"<dt><b>Sebastian \"seezer\" Goth</b></dt><dd>Many improvements and features</dd>"
"<dt><b>Michael \"brot\" Groh</b></dt><dd>German translation, fixes</dd>"
"<dt><b>\"Gryllida\"</b></dt><dd>IRC parser improvements</dd>"
"<dt><b>H. İbrahim \"igungor\" Güngör</b></dt><dd>Turkish translation</dd>"
"<dt><b>Jiri Grönroos</b></dt><dd>Finnish translation</dd>"
"<dt><b>Chris \"Zren\" H</b></dt><dd>Various improvements</dd>"
"<dt><b>Edward Hades</b></dt><dd>Russian translation</dd>"
"<dt><b>John \"nox\" Hand</b></dt><dd>Former All-Seeing Eye logo</dd>"
"<dt><b>Adam \"2kah\" Harwood</b></dt><dd>ChatView improvements</dd>"
"<dt><b>Jonas \"Dante\" Heese</b></dt><dd>Project founder, various improvements</dd>"
"<dt><b>Thomas \"Datafreak\" Hogh</b></dt><dd>Windows builder</dd>"
"<dt><b>Johannes \"j0hu\" Huber</b></dt><dd>Many fixes and features, bug triaging</dd>"
"<dt><b>Theofilos Intzoglou</b></dt><dd>Greek translation</dd>"
"<dt><b>Jovan Jojkić</b></dt><dd>Serbian translation</dd>"
"<dt><b>Allan Jude</b></dt><dd>Documentation improvements</dd>"
"<dt><b>Michael \"ycros\" Kedzierski</b></dt><dd>Mac fixes</dd>"
"<dt><b>Scott \"ScottK\" Kitterman<b></dt><dd>Kubuntu nightly packager, (packaging/build system) bughunter</dd>"
"<dt><b>Paul \"Haudrauf\" Klumpp</b></dt><dd>Initial design and mainwindow layout</dd>"
"<dt><b>Maia Kozheva</b></dt><dd>Russian translation</dd>"
"<dt><b>Tae-Hoon Kwon</b></dt><dd>Korean translation</dd>"
"<dt><b>\"Larso\"</b></dt><dd>Finnish translation</dd>"
"<dt><b>Patrick \"bonsaikitten\" Lauer</b></dt><dd>Gentoo packaging</dd>"
"<dt><b>Chris \"Fish-Face\" Le Sueur</b></dt><dd>Various fixes and improvements</dd>"
"<dt><b>Jerome \"Adys\" Leclanche</b></dt><dd>Context menu fixes</dd>"
"<dt><b>Hendrik \"nevcairiel\" Leppkes</b></dt><dd>Various features</dd>"
"<dt><b>Jason Lynch</b></dt><dd>Bugfixes</dd>"
"<dt><b>Awad \"firesock\" Mackie</b></dt><dd>ChatView improvements</dd>"
"<dt><b>Michael \"mamarley\" Marley</b></dt><dd>Various fixes and improvements</dd>"
"<dt><b>Martin \"m4yer\" Mayer</b></dt><dd>German translation</dd>"
"<dt><b>Daniel \"hydrogen\" Meltzer</b></dt><dd>Various fixes and improvements</dd>"
"<dt><b>Sebastian Meyer</b></dt><dd>Fixes</dd>"
"<dt><b>Daniel E. Moctezuma</b></dt><dd>Japanese translation</dd>"
"<dt><b>Chris \"kode54\" Moeller</b></dt><dd>Various fixes and improvements</dd>"
"<dt><b>Thomas Müller</b></dt><dd>Fixes, Debian packaging</dd>"
"<dt><b>Gábor \"ELITE_x\" Németh</b></dt><dd>Hungarian translation</dd>"
"<dt><b>Per Nielsen</b></dt><dd>Danish translation</dd>"
"<dt><b>J-P Nurmi</b></dt><dd>Fixes</dd>"
"<dt><b>Marco \"Quizzlo\" Paolone</b></dt><dd>Italian translation</dd>"
"<dt><b>Bas \"Tucos\" Pape</b></dt><dd>Many fixes and improvements, bug and patch triaging, tireless community support</dd>"
"<dt><b>Bruno Patri</b></dt><dd>French translation</dd>"
"<dt><b>Drew \"LinuxDolt\" Patridge</b></dt><dd>BluesTheme stylesheet</dd>"
"<dt><b>Celeste \"seele\" Paul</b></dt><dd>Usability Queen</dd>"
"<dt><b>Vit Pelcak</b></dt><dd>Czech translation</dd>"
"<dt><b>Regis \"ZRegis\" Perrin</b></dt><dd>French translation</dd>"
"<dt><b>Diego \"Flameeyes\" Petten&ograve;</b></dt><dd>Gentoo maintainer, build system improvements</dd>"
"<dt><b>Simon Philips</b></dt><dd>Dutch translation</dd>"
"<dt><b>Daniel \"billie\" Pielmeier</b></dt><dd>Gentoo maintainer</dd>"
"<dt><b>Nuno \"pinheiro\" Pinheiro</b></dt><dd>Tons of Oxygen icons including our application icon</dd>"
"<dt><b>David Planella</b></dt><dd>Translation system fixes</dd>"
"<dt><b>Jure \"JLP\" Repinc</b></dt><dd>Slovenian translation</dd>"
"<dt><b>Patrick \"TheOneRing\" von Reth</b></dt><dd>MinGW support, SNORE backend, Windows packager</dd>"
"<dt><b>Dirk \"MarcLandis\" Rettschlag</b></dt><dd>Various fixes and new features</dd>"
"<dt><b>Miguel Revilla</b></dt><dd>Spanish translation</dd>"
"<dt><b>Jaak Ristioja</b></dt><dd>Fixes</dd>"
"<dt><b>David \"Bombe\" Roden</b></dt><dd>Fixes</dd>"
"<dt><b>Henning \"honk\" Rohlfs</b></dt><dd>Various fixes</dd>"
"<dt><b>Stella \"differentreality\" Rouzi</b></dt><dd>Greek translation</dd>"
"<dt><b>\"salnx\"</b></dt><dd>Highlight configuration improvements</dd>"
"<dt><b>Martin \"sandsmark\" Sandsmark</b></dt><dd>Core fixes, Quasseldroid</dd>"
"<dt><b>David Sansome</b></dt><dd>OSX Notification Center support</dd>"
"<dt><b>Dennis \"DevUrandom\" Schridde</b></dt><dd>D-Bus notifications</dd>"
"<dt><b>Jussi \"jussi01\" Schultink</b></dt><dd>Tireless tester, {ku|U}buntu tester and lobbyist, liters of delicious Finnish alcohol</dd>"
"<dt><b>Tim \"xAFFE\" Schumacher</b></dt><dd>Fixes and feedback</dd>"
"<dt><b>\"sfionov\"</b></dt><dd>Russian translation</dd>"
"<dt><b>Harald \"apachelogger\" Sitter</b></dt><dd>{ku|U}buntu packager, motivator, promoter</dd>"
"<dt><b>Ramanathan Sivagurunathan</b></dt><dd>Fixes</dd>"
"<dt><b>Stefanos Sofroniou</b></dt><dd>Greek translation</dd>"
"<dt><b>Rüdiger \"ruediger\" Sonderfeld</b></dt><dd>Emacs keybindings</dd>"
"<dt><b>Alexander Stein</b></dt><dd>Tray icon fix</dd>"
"<dt><b>Daniel \"son\" Steinmetz</b></dt><dd>Early beta tester and bughunter (on Vista&trade;!)</dd>"
"<dt><b>Jesper Thomschütz</b></dt><dd>Various fixes</dd>"
"<dt><b>Arthur \"roentgen\" Titeica</b></dt><dd>Romanian translation</dd>"
"<dt><b>\"ToBeFree\"</b></dt><dd>German translation</dd>"
"<dt><b>Edward \"Aides\" Toroshchin</b></dt><dd>Russian translation</dd>"
"<dt><b>Adam \"adamt\" Tulinius</b></dt><dd>Early beta tester and bughunter, Danish translation</dd>"
"<dt><b>Deniz Türkoglu</b></dt><dd>Mac fixes</dd>"
"<dt><b>Frederik M.J. \"freqmod\" Vestre</b></dt><dd>Norwegian translation</dd>"
"<dt><b>Atte Virtanen</b></dt><dd>Finnish translation</dd>"
"<dt><b>Pavel \"int\" Volkovitskiy</b></dt><dd>Early beta tester and bughunter</dd>"
"<dt><b>Roscoe van Wyk</b></dt><dd>Fixes</dd>"
"<dt><b>Zé</b></dt><dd>Portuguese translation</dd>"
"<dt><b>Benjamin \"zbenjamin\" Zeller</b></dt><dd>Windows build system fixes</dd>"
"<dt><b>\"zeugma\"</b></dt><dd>Turkish translation</dd>"
"</dl><br>"
"...and anybody else finding and reporting bugs, giving feedback, helping others and being part of the community!");
return res;
}
QString AboutDlg::thanksTo() const
{
QString res;
res = tr("Special thanks goes to:<br>"
"<dl>"
"<dt><img src=\":/pics/quassel-eye.png\">&nbsp;<b>John \"nox\" Hand</b></dt>"
"<dd>for the original Quassel icon - The All-Seeing Eye</dt>"
"<dt><img src=\":/pics/oxygen.png\">&nbsp;<b><a href=\"http://www.oxygen-icons.org\">The Oxygen Team</a></b></dt>"
"<dd>for creating all the artwork you see throughout Quassel</dd>"
"<dt><img src=\":/pics/qt-logo-32.png\">&nbsp;<b><a href=\"http://www.trolltech.com\">Qt Software formerly known as Trolltech</a></b></dt>"
"<dd>for creating Qt and Qtopia, and for sponsoring development of QuasselTopia with Greenphones and more</dd>"
"<dt><a href=\"http://www.nokia.com\"><img src=\":/pics/nokia.png\"></a></b></dt>"
"<dd>for keeping Qt alive, and for sponsoring development of Quassel Mobile with N810s</dd>"
);
return res;
}

View file

@ -1,45 +0,0 @@
/***************************************************************************
* Copyright (C) 2005-2014 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef ABOUTDLG_H_
#define ABOUTDLG_H_
#include <QDialog>
#include "ui_aboutdlg.h"
class AboutDlg : public QDialog
{
Q_OBJECT
public:
AboutDlg(QWidget *parent = 0);
private:
Ui::AboutDlg ui;
QString about() const;
QString authors() const;
QString contributors() const;
QString thanksTo() const;
};
#endif

View file

@ -77,16 +77,16 @@ BufferWidget::BufferWidget(QWidget *parent)
Action *zoomInChatview = coll->add<Action>("ZoomInChatView", this, SLOT(zoomIn()));
zoomInChatview->setText(tr("Zoom In"));
zoomInChatview->setIcon(QIcon::fromTheme("zoom-in"));
zoomInChatview->setIcon(KIcon("zoom-in"));
zoomInChatview->setShortcut(QKeySequence::ZoomIn);
Action *zoomOutChatview = coll->add<Action>("ZoomOutChatView", this, SLOT(zoomOut()));
zoomOutChatview->setIcon(QIcon::fromTheme("zoom-out"));
zoomOutChatview->setIcon(KIcon("zoom-out"));
zoomOutChatview->setText(tr("Zoom Out"));
zoomOutChatview->setShortcut(QKeySequence::ZoomOut);
Action *zoomOriginalChatview = coll->add<Action>("ZoomOriginalChatView", this, SLOT(zoomOriginal()));
zoomOriginalChatview->setIcon(QIcon::fromTheme("zoom-original"));
zoomOriginalChatview->setIcon(KIcon("zoom-original"));
zoomOriginalChatview->setText(tr("Actual Size"));
//zoomOriginalChatview->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_0)); // used for RTS switching

View file

@ -22,9 +22,10 @@
#include <QHeaderView>
#include <QHBoxLayout>
#include <QIcon>
#include <QSpacerItem>
#include <KIcon>
#include "client.h"
#include "clientirclisthelper.h"
@ -41,7 +42,7 @@ ChannelListDlg::ChannelListDlg(QWidget *parent)
_sortFilter.setFilterKeyColumn(-1);
ui.setupUi(this);
ui.advancedModeLabel->setPixmap(QIcon::fromTheme("edit-rename").pixmap(22));
ui.advancedModeLabel->setPixmap(KIcon("edit-rename").pixmap(22));
ui.channelListView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui.channelListView->setSelectionMode(QAbstractItemView::SingleSelection);
@ -54,7 +55,7 @@ ChannelListDlg::ChannelListDlg(QWidget *parent)
ui.searchChannelsButton->setAutoDefault(false);
setWindowIcon(QIcon::fromTheme("format-list-unordered"));
setWindowIcon(KIcon("format-list-unordered"));
connect(ui.advancedModeLabel, SIGNAL(clicked()), this, SLOT(toggleMode()));
connect(ui.searchChannelsButton, SIGNAL(clicked()), this, SLOT(requestSearch()));
@ -132,14 +133,14 @@ void ChannelListDlg::setAdvancedMode(bool advanced)
delete _simpleModeSpacer;
_simpleModeSpacer = 0;
}
ui.advancedModeLabel->setPixmap(QIcon::fromTheme("edit-clear-locationbar-rtl", QIcon::fromTheme("edit-clear")).pixmap(16));
ui.advancedModeLabel->setPixmap(KIcon("edit-clear-locationbar-rtl").pixmap(16)); // "edit-clear")
}
else {
if (!_simpleModeSpacer) {
_simpleModeSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
ui.searchLayout->insertSpacerItem(0, _simpleModeSpacer);
}
ui.advancedModeLabel->setPixmap(QIcon::fromTheme("edit-rename").pixmap(16));
ui.advancedModeLabel->setPixmap(KIcon("edit-rename").pixmap(16));
}
ui.channelNameLineEdit->clear();

View file

@ -798,7 +798,7 @@ void ContentsChatItem::addActionsToMenu(QMenu *menu, const QPointF &pos)
switch (click.type()) {
case Clickable::Url:
privateData()->activeClickable = click;
menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy Link Address"),
menu->addAction(KIcon("edit-copy"), tr("Copy Link Address"),
&_actionProxy, SLOT(copyLinkToClipboard()))->setData(QVariant::fromValue<void *>(this));
break;
case Clickable::Channel:
@ -836,32 +836,12 @@ void ContentsChatItem::copyLinkToClipboard()
void ContentsChatItem::showWebPreview(const Clickable &click)
{
#ifndef HAVE_WEBKIT
Q_UNUSED(click);
#else
QTextLine line = layout()->lineForTextPosition(click.start());
qreal x = line.cursorToX(click.start());
qreal width = line.cursorToX(click.start() + click.length()) - x;
qreal height = line.height();
qreal y = height * line.lineNumber();
QPointF topLeft = mapToScene(pos()) + QPointF(x, y);
QRectF urlRect = QRectF(topLeft.x(), topLeft.y(), width, height);
QString urlstr = data(ChatLineModel::DisplayRole).toString().mid(click.start(), click.length());
if (!urlstr.contains("://"))
urlstr = "http://" + urlstr;
QUrl url = QUrl::fromEncoded(urlstr.toUtf8(), QUrl::TolerantMode);
chatScene()->loadWebPreview(this, url, urlRect);
#endif
}
void ContentsChatItem::clearWebPreview()
{
#ifdef HAVE_WEBKIT
chatScene()->clearWebPreview(this);
#endif
}

View file

@ -21,10 +21,11 @@
#include "chatmonitorview.h"
#include <QAction>
#include <QIcon>
#include <QMenu>
#include <QContextMenuEvent>
#include <KIcon>
#include "chatmonitorfilter.h"
#include "chatlinemodel.h"
#include "chatitem.h"
@ -70,7 +71,7 @@ void ChatMonitorView::addActionsToMenu(QMenu *menu, const QPointF &pos)
}
menu->addSeparator();
menu->addAction(QIcon::fromTheme("configure"), tr("Configure..."), this, SLOT(showSettingsPage()));
menu->addAction(KIcon("configure"), tr("Configure..."), this, SLOT(showSettingsPage()));
}

View file

@ -32,9 +32,6 @@
# include <KMenuBar>
#ifdef HAVE_WEBKIT
# include <QWebView>
#endif
#include "chatitem.h"
#include "chatline.h"
@ -51,7 +48,6 @@
#include "qtui.h"
#include "qtuistyle.h"
#include "chatviewsettings.h"
#include "webpreviewitem.h"
const qreal minContentsWidth = 200;
@ -118,10 +114,6 @@ ChatScene::ChatScene(QAbstractItemModel *model, const QString &idString, qreal w
this, SLOT(rowsRemoved()));
connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), SLOT(dataChanged(QModelIndex, QModelIndex)));
#ifdef HAVE_WEBKIT
webPreview.timer.setSingleShot(true);
connect(&webPreview.timer, SIGNAL(timeout()), this, SLOT(webPreviewNextStep()));
#endif
_showWebPreview = defaultSettings.showWebPreview();
defaultSettings.notify("ShowWebPreview", this, SLOT(showWebPreviewChanged()));
@ -819,7 +811,7 @@ void ChatScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
// If we have text selected, insert the Copy Selection as first item
if (isPosOverSelection(pos)) {
QAction *sep = menu.insertSeparator(menu.actions().first());
QAction *act = new Action(QIcon::fromTheme("edit-copy"), tr("Copy Selection"), &menu, this,
QAction *act = new Action(KIcon("edit-copy"), tr("Copy Selection"), &menu, this,
SLOT(selectionToClipboard()), QKeySequence::Copy);
menu.insertAction(sep, act);
@ -828,7 +820,7 @@ void ChatScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
searchSelectionText = searchSelectionText.left(_webSearchSelectionTextMaxVisible).append(QString::fromUtf8(""));
searchSelectionText = tr("Search '%1'").arg(searchSelectionText);
menu.addAction(QIcon::fromTheme("edit-find"), searchSelectionText, this, SLOT(webSearchOnSelection()));
menu.addAction(KIcon("edit-find"), searchSelectionText, this, SLOT(webSearchOnSelection()));
}
if (QtUi::mainWindow()->menuBar()->isHidden())
@ -1168,130 +1160,6 @@ void ChatScene::updateSceneRect(const QRectF &rect)
// ========================================
// Webkit Only stuff
// ========================================
#ifdef HAVE_WEBKIT
void ChatScene::loadWebPreview(ChatItem *parentItem, const QUrl &url, const QRectF &urlRect)
{
if (!_showWebPreview)
return;
if (webPreview.urlRect != urlRect)
webPreview.urlRect = urlRect;
if (webPreview.parentItem != parentItem)
webPreview.parentItem = parentItem;
if (webPreview.url != url) {
webPreview.url = url;
// prepare to load a different URL
if (webPreview.previewItem) {
if (webPreview.previewItem->scene())
removeItem(webPreview.previewItem);
delete webPreview.previewItem;
webPreview.previewItem = 0;
}
webPreview.previewState = WebPreview::NoPreview;
}
if (webPreview.url.isEmpty())
return;
// qDebug() << Q_FUNC_INFO << webPreview.previewState;
switch (webPreview.previewState) {
case WebPreview::NoPreview:
webPreview.previewState = WebPreview::NewPreview;
webPreview.timer.start(500);
break;
case WebPreview::NewPreview:
case WebPreview::DelayPreview:
case WebPreview::ShowPreview:
// we're already waiting for the next step or showing the preview
break;
case WebPreview::HidePreview:
// we still have a valid preview
webPreview.previewState = WebPreview::DelayPreview;
webPreview.timer.start(1000);
break;
}
// qDebug() << " new State:" << webPreview.previewState << webPreview.timer.isActive();
}
void ChatScene::webPreviewNextStep()
{
// qDebug() << Q_FUNC_INFO << webPreview.previewState;
switch (webPreview.previewState) {
case WebPreview::NoPreview:
break;
case WebPreview::NewPreview:
Q_ASSERT(!webPreview.previewItem);
webPreview.previewItem = new WebPreviewItem(webPreview.url);
webPreview.previewState = WebPreview::DelayPreview;
webPreview.timer.start(1000);
break;
case WebPreview::DelayPreview:
Q_ASSERT(webPreview.previewItem);
// calc position and show
{
qreal previewY = webPreview.urlRect.bottom();
qreal previewX = webPreview.urlRect.x();
if (previewY + webPreview.previewItem->boundingRect().height() > sceneRect().bottom())
previewY = webPreview.urlRect.y() - webPreview.previewItem->boundingRect().height();
if (previewX + webPreview.previewItem->boundingRect().width() > sceneRect().width())
previewX = sceneRect().right() - webPreview.previewItem->boundingRect().width();
webPreview.previewItem->setPos(previewX, previewY);
}
addItem(webPreview.previewItem);
webPreview.previewState = WebPreview::ShowPreview;
break;
case WebPreview::ShowPreview:
qWarning() << "ChatScene::webPreviewNextStep() called while in ShowPreview Step!";
qWarning() << "removing preview";
if (webPreview.previewItem && webPreview.previewItem->scene())
removeItem(webPreview.previewItem);
// Fall through to deletion!
case WebPreview::HidePreview:
if (webPreview.previewItem) {
delete webPreview.previewItem;
webPreview.previewItem = 0;
}
webPreview.parentItem = 0;
webPreview.url = QUrl();
webPreview.urlRect = QRectF();
webPreview.previewState = WebPreview::NoPreview;
}
// qDebug() << " new State:" << webPreview.previewState << webPreview.timer.isActive();
}
void ChatScene::clearWebPreview(ChatItem *parentItem)
{
// qDebug() << Q_FUNC_INFO << webPreview.previewState;
switch (webPreview.previewState) {
case WebPreview::NewPreview:
webPreview.previewState = WebPreview::NoPreview; // we haven't loaded anything yet
break;
case WebPreview::ShowPreview:
if (parentItem == 0 || webPreview.parentItem == parentItem) {
if (webPreview.previewItem && webPreview.previewItem->scene())
removeItem(webPreview.previewItem);
}
// fall through into to set hidden state
case WebPreview::DelayPreview:
// we're just loading, so haven't shown the preview yet.
webPreview.previewState = WebPreview::HidePreview;
webPreview.timer.start(5000);
break;
case WebPreview::NoPreview:
case WebPreview::HidePreview:
break;
}
// qDebug() << " new State:" << webPreview.previewState << webPreview.timer.isActive();
}
#endif
// ========================================
// end of webkit only

View file

@ -149,10 +149,6 @@ public slots:
void requestBacklog();
#ifdef HAVE_WEBKIT
void loadWebPreview(ChatItem *parentItem, const QUrl &url, const QRectF &urlRect);
void clearWebPreview(ChatItem *parentItem = 0);
#endif
signals:
void lastLineChanged(QGraphicsItem *item, qreal offset);
@ -175,9 +171,6 @@ protected slots:
private slots:
void firstHandlePositionChanged(qreal xpos);
void secondHandlePositionChanged(qreal xpos);
#ifdef HAVE_WEBKIT
void webPreviewNextStep();
#endif
void showWebPreviewChanged();
void rowsRemoved();
@ -228,25 +221,6 @@ private:
static const int _webSearchSelectionTextMaxVisible = 24;
#ifdef HAVE_WEBKIT
struct WebPreview {
enum PreviewState {
NoPreview,
NewPreview,
DelayPreview,
ShowPreview,
HidePreview
};
ChatItem *parentItem;
QGraphicsItem *previewItem;
QUrl url;
QRectF urlRect;
PreviewState previewState;
QTimer timer;
WebPreview() : parentItem(0), previewItem(0), previewState(NoPreview) {}
};
WebPreview webPreview;
#endif // HAVE_WEBKIT
};

View file

@ -30,9 +30,9 @@ ChatViewSearchBar::ChatViewSearchBar(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
ui.hideButton->setIcon(QIcon::fromTheme("dialog-close"));
ui.searchUpButton->setIcon(QIcon::fromTheme("go-up"));
ui.searchDownButton->setIcon(QIcon::fromTheme("go-down"));
ui.hideButton->setIcon(KIcon("dialog-close"));
ui.searchUpButton->setIcon(KIcon("go-up"));
ui.searchDownButton->setIcon(KIcon("go-down"));
_searchDelayTimer.setSingleShot(true);
layout()->setContentsMargins(0, 0, 0, 0);

View file

@ -21,9 +21,10 @@
#include <QDebug>
#include <QAbstractButton>
#include <QFormLayout>
#include <QIcon>
#include <QSpinBox>
#include <KIcon>
#include "coreconfigwizard.h"
#include "coreconnection.h"
@ -67,7 +68,7 @@ CoreConfigWizard::CoreConfigWizard(CoreConnection *connection, const QList<QVari
setModal(true);
setWindowTitle(tr("Core Configuration Wizard"));
setPixmap(QWizard::LogoPixmap, QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png")).pixmap(48));
setPixmap(QWizard::LogoPixmap, KIcon("kuassel").pixmap(48));
connect(connection, SIGNAL(coreSetupSuccess()), SLOT(coreSetupSuccess()));
connect(connection, SIGNAL(coreSetupFailed(QString)), SLOT(coreSetupFailed(QString)));

View file

@ -19,11 +19,11 @@
***************************************************************************/
#include <QDialogButtonBox>
#include <QIcon>
#include <QVBoxLayout>
#include "coreconnectdlg.h"
#include <KIcon>
#include "coreconnectdlg.h"
#include "clientsettings.h"
#include "coreaccountsettingspage.h"
@ -39,7 +39,7 @@ CoreConnectDlg::CoreConnectDlg(QWidget *parent) : QDialog(parent)
_settingsPage->setSelectedAccount(lastAccount);
setWindowTitle(tr("Connect to Core"));
setWindowIcon(QIcon::fromTheme("network-disconnect"));
setWindowIcon(KIcon("network-disconnect"));
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(_settingsPage);

View file

@ -18,10 +18,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <KIcon>
#include "coreconnectionstatuswidget.h"
#include <QIcon>
#include "client.h"
#include "signalproxy.h"
@ -80,11 +79,11 @@ void CoreConnectionStatusWidget::connectionStateChanged(CoreConnection::Connecti
{
if (state >= CoreConnection::Connected) {
if (coreConnection()->isEncrypted()) {
ui.sslLabel->setPixmap(QIcon::fromTheme("security-high").pixmap(16));
ui.sslLabel->setPixmap(KIcon("security-high").pixmap(16));
ui.sslLabel->setToolTip(tr("The connection to your core is encrypted with SSL."));
}
else {
ui.sslLabel->setPixmap(QIcon::fromTheme("security-low").pixmap(16));
ui.sslLabel->setPixmap(KIcon("security-low").pixmap(16));
ui.sslLabel->setToolTip(tr("The connection to your core is not encrypted."));
}
ui.sslLabel->show();

View file

@ -177,7 +177,7 @@ IndicatorNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent)
{
ui.setupUi(this);
// FIXME find proper icon (this one is used by the plasmoid as well)
ui.enabled->setIcon(QIcon::fromTheme("mail-message-new"));
ui.enabled->setIcon(KIcon("mail-message-new"));
connect(ui.enabled, SIGNAL(toggled(bool)), SLOT(widgetChanged()));
}

View file

@ -61,11 +61,11 @@ InputWidget::InputWidget(QWidget *parent)
ui.inputEdit->setMode(MultiLineEdit::MultiLine);
ui.inputEdit->setPasteProtectionEnabled(true);
ui.boldButton->setIcon(QIcon::fromTheme("format-text-bold"));
ui.italicButton->setIcon(QIcon::fromTheme("format-text-italic"));
ui.underlineButton->setIcon(QIcon::fromTheme("format-text-underline"));
ui.textcolorButton->setIcon(QIcon::fromTheme("format-text-color"));
ui.highlightcolorButton->setIcon(QIcon::fromTheme("format-fill-color"));
ui.boldButton->setIcon(KIcon("format-text-bold"));
ui.italicButton->setIcon(KIcon("format-text-italic"));
ui.underlineButton->setIcon(KIcon("format-text-underline"));
ui.textcolorButton->setIcon(KIcon("format-text-color"));
ui.highlightcolorButton->setIcon(KIcon("format-fill-color"));
ui.encryptionIconLabel->hide();
_colorMenu = new QMenu();
@ -469,7 +469,7 @@ void InputWidget::updateNickSelector() const
ui.ownNick->addItems(nicks);
if (me && me->isAway())
ui.ownNick->setItemData(nickIdx, QIcon::fromTheme("user-away"), Qt::DecorationRole);
ui.ownNick->setItemData(nickIdx, KIcon("user-away"), Qt::DecorationRole);
ui.ownNick->setCurrentIndex(nickIdx);
}
@ -586,7 +586,7 @@ void InputWidget::colorChosen(QAction *action)
mergeFormatOnSelection(fmt);
}
ui.textcolorButton->setDefaultAction(action);
ui.textcolorButton->setIcon(createColorToolButtonIcon(QIcon::fromTheme("format-text-color"), color));
ui.textcolorButton->setIcon(createColorToolButtonIcon(KIcon("format-text-color"), color));
}
@ -606,7 +606,7 @@ void InputWidget::colorHighlightChosen(QAction *action)
mergeFormatOnSelection(fmt);
}
ui.highlightcolorButton->setDefaultAction(action);
ui.highlightcolorButton->setIcon(createColorToolButtonIcon(QIcon::fromTheme("format-fill-color"), color));
ui.highlightcolorButton->setIcon(createColorToolButtonIcon(KIcon("format-fill-color"), color));
}

View file

@ -54,7 +54,7 @@ IrcConnectionWizard::IrcConnectionWizard(QWidget *parent, Qt::WindowFlags flags)
QWizardPage *IrcConnectionWizard::createIntroductionPage(QWidget *parent)
{
QWizardPage *page = new QWizardPage(parent);
page->setTitle(QObject::tr("Welcome to Quassel IRC"));
page->setTitle(QObject::tr("Welcome to Kuassel"));
QLabel *label = new QLabel(QObject::tr("This wizard will help you to set up your default identity and your IRC network connection.<br>"
"This only covers basic settings. You can cancel this wizard any time and use the settings dialog for more detailed changes."), page);

View file

@ -18,14 +18,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <KNotification>
#include <KNotifyConfigWidget>
#include <QIcon>
#include <QTextDocument>
#include <QVBoxLayout>
#include "knotificationbackend.h"
#include <KNotification>
#include <KNotifyConfigWidget>
#include <KIcon>
#include "knotificationbackend.h"
#include "client.h"
#include "mainwin.h"
#include "networkmodel.h"
@ -60,7 +60,7 @@ void KNotificationBackend::notify(const Notification &n)
#else
QString message = QString("<b>&lt;%1&gt;</b> %2").arg(n.sender, n.message.toHtmlEscaped());
#endif
KNotification *notification = KNotification::event(type, message, QIcon::fromTheme("dialog-information").pixmap(48), QtUi::mainWindow(),
KNotification *notification = KNotification::event(type, message, KIcon("dialog-information").pixmap(48), QtUi::mainWindow(),
KNotification::RaiseWidgetOnActivation
|KNotification::CloseWhenWidgetActivated
|KNotification::CloseOnTimeout);
@ -129,7 +129,7 @@ void KNotificationBackend::notificationActivated(uint notificationId)
void KNotificationBackend::updateToolTip()
{
QtUi::mainWindow()->systemTray()->setToolTip("Quassel IRC",
QtUi::mainWindow()->systemTray()->setToolTip("Kuassel",
_notifications.count() ? tr("%n pending highlight(s)", "", _notifications.count()) : QString());
}
@ -145,7 +145,7 @@ SettingsPage *KNotificationBackend::createConfigWidget() const
KNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : SettingsPage("Internal", "KNotification", parent)
{
_widget = new KNotifyConfigWidget(this);
_widget->setApplication("quassel");
_widget->setApplication("kuassel");
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(_widget);

View file

@ -35,12 +35,12 @@
#include <KToggleFullScreenAction>
#include <KToolBar>
#include <KWindowSystem>
#include <KAboutApplicationDialog>
#ifdef Q_WS_X11
# include <QX11Info>
#endif
#include "aboutdlg.h"
#include "awaylogfilter.h"
#include "awaylogview.h"
#include "action.h"
@ -90,7 +90,6 @@
#include "toolbaractionprovider.h"
#include "topicwidget.h"
#include "verticaldock.h"
#include "knotificationbackend.h"
#ifdef HAVE_SSL
@ -101,10 +100,6 @@
#include "indicatornotificationbackend.h"
#endif
#ifdef HAVE_DBUS
#include "dockmanagernotificationbackend.h"
#endif
#include "settingspages/aliasessettingspage.h"
#include "settingspages/appearancesettingspage.h"
#include "settingspages/backlogsettingspage.h"
@ -144,9 +139,9 @@ MainWin::MainWin(QWidget *parent)
QApplication::setQuitOnLastWindowClosed(false);
setWindowTitle("Quassel IRC");
setWindowIconText("Quassel IRC");
updateIcon();
setWindowTitle("Kuassel IRC");
setWindowIconText("Kuassel IRC");
qApp->setWindowIcon(KIcon("kuassel"));
}
@ -196,10 +191,6 @@ void MainWin::init()
QtUi::registerNotificationBackend(new IndicatorNotificationBackend(this));
#endif
#ifdef HAVE_DBUS
QtUi::registerNotificationBackend(new DockManagerNotificationBackend(this));
#endif
// we assume that at this point, all configurable actions are defined!
QtUi::loadShortcuts();
@ -221,6 +212,12 @@ void MainWin::init()
// No autoconnect selected (or no accounts)
showCoreConnectionDlg();
}
if (Quassel::isOptionSet("url")) {
// FIXME: connect to channel upon request from external KDE application
qWarning() << "non-interactive connection not yet implemented:" << Quassel::optionValue("url");
}
}
@ -275,33 +272,20 @@ void MainWin::restoreStateFromSettings(UiSettings &s)
show();
}
void MainWin::updateIcon()
{
QIcon icon;
if (Client::isConnected())
icon = QIcon::fromTheme("quassel", QIcon(":/icons/quassel-128.png"));
else
icon = QIcon::fromTheme("quassel-inactive", QIcon(":/icons/quassel-128.png"));
setWindowIcon(icon);
qApp->setWindowIcon(icon);
}
void MainWin::setupActions()
{
ActionCollection *coll = QtUi::actionCollection("General", tr("General"));
// File
coll->addAction("ConnectCore", new Action(QIcon::fromTheme("network-connect"), tr("&Connect to Core..."), coll,
coll->addAction("ConnectCore", new Action(KIcon("network-connect"), tr("&Connect to Core..."), coll,
this, SLOT(showCoreConnectionDlg())));
coll->addAction("DisconnectCore", new Action(QIcon::fromTheme("network-disconnect"), tr("&Disconnect from Core"), coll,
coll->addAction("DisconnectCore", new Action(KIcon("network-disconnect"), tr("&Disconnect from Core"), coll,
Client::instance(), SLOT(disconnectFromCore())));
coll->addAction("CoreInfo", new Action(QIcon::fromTheme("help-about"), tr("Core &Info..."), coll,
coll->addAction("CoreInfo", new Action(KIcon("help-about"), tr("Core &Info..."), coll,
this, SLOT(showCoreInfoDlg())));
coll->addAction("ConfigureNetworks", new Action(QIcon::fromTheme("configure"), tr("Configure &Networks..."), coll,
coll->addAction("ConfigureNetworks", new Action(KIcon("configure"), tr("Configure &Networks..."), coll,
this, SLOT(on_actionConfigureNetworks_triggered())));
// FIXME: use QKeySequence::Quit once we depend on Qt 4.6
coll->addAction("Quit", new Action(QIcon::fromTheme("application-exit"), tr("&Quit"), coll,
coll->addAction("Quit", new Action(KIcon("application-exit"), tr("&Quit"), coll,
this, SLOT(quit()), Qt::CTRL + Qt::Key_Q));
// View
@ -312,11 +296,11 @@ void MainWin::setupActions()
lockAct->setCheckable(true);
connect(lockAct, SIGNAL(toggled(bool)), SLOT(on_actionLockLayout_toggled(bool)));
coll->addAction("ToggleSearchBar", new Action(QIcon::fromTheme("edit-find"), tr("Show &Search Bar"), coll,
coll->addAction("ToggleSearchBar", new Action(KIcon("edit-find"), tr("Show &Search Bar"), coll,
0, 0, QKeySequence::Find))->setCheckable(true);
coll->addAction("ShowAwayLog", new Action(tr("Show Away Log"), coll,
this, SLOT(showAwayLog())));
coll->addAction("ToggleMenuBar", new Action(QIcon::fromTheme("show-menu"), tr("Show &Menubar"), coll,
coll->addAction("ToggleMenuBar", new Action(KIcon("show-menu"), tr("Show &Menubar"), coll,
0, 0, QKeySequence(Qt::CTRL + Qt::Key_M)))->setCheckable(true);
coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll,
@ -326,47 +310,38 @@ void MainWin::setupActions()
coll->addAction("ToggleFullScreen", fullScreenAct);
// Settings
QAction *configureShortcutsAct = new Action(QIcon::fromTheme("configure-shortcuts"), tr("Configure &Shortcuts..."), coll,
QAction *configureShortcutsAct = new Action(KIcon("configure-shortcuts"), tr("Configure &Shortcuts..."), coll,
this, SLOT(showShortcutsDlg()));
configureShortcutsAct->setMenuRole(QAction::NoRole);
coll->addAction("ConfigureShortcuts", configureShortcutsAct);
#ifdef Q_OS_MAC
QAction *configureQuasselAct = new Action(QIcon::fromTheme("configure"), tr("&Configure Quassel..."), coll,
this, SLOT(showSettingsDlg()));
configureQuasselAct->setMenuRole(QAction::PreferencesRole);
#else
QAction *configureQuasselAct = new Action(QIcon::fromTheme("configure"), tr("&Configure Quassel..."), coll,
QAction *configureQuasselAct = new Action(KIcon("configure"), tr("&Configure Kuassel..."), coll,
this, SLOT(showSettingsDlg()), QKeySequence(Qt::Key_F7));
#endif
coll->addAction("ConfigureQuassel", configureQuasselAct);
// Help
QAction *aboutQuasselAct = new Action(QIcon(":/icons/quassel.png"), tr("&About Quassel"), coll,
this, SLOT(showAboutDlg()));
aboutQuasselAct->setMenuRole(QAction::AboutRole);
coll->addAction("AboutQuassel", aboutQuasselAct);
QAction *aboutQtAct = new Action(QIcon(":/pics/qt-logo.png"), tr("About &Qt"), coll,
qApp, SLOT(aboutQt()));
aboutQtAct->setMenuRole(QAction::AboutQtRole);
coll->addAction("AboutQt", aboutQtAct);
coll->addAction("DebugNetworkModel", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &NetworkModel"), coll,
// Tools
coll->addAction("DebugNetworkModel", new Action(KIcon("tools-report-bug"), tr("Debug &NetworkModel"), coll,
this, SLOT(on_actionDebugNetworkModel_triggered())));
coll->addAction("DebugBufferViewOverlay", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &BufferViewOverlay"), coll,
coll->addAction("DebugBufferViewOverlay", new Action(KIcon("tools-report-bug"), tr("Debug &BufferViewOverlay"), coll,
this, SLOT(on_actionDebugBufferViewOverlay_triggered())));
coll->addAction("DebugMessageModel", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &MessageModel"), coll,
coll->addAction("DebugMessageModel", new Action(KIcon("tools-report-bug"), tr("Debug &MessageModel"), coll,
this, SLOT(on_actionDebugMessageModel_triggered())));
coll->addAction("DebugHotList", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &HotList"), coll,
coll->addAction("DebugHotList", new Action(KIcon("tools-report-bug"), tr("Debug &HotList"), coll,
this, SLOT(on_actionDebugHotList_triggered())));
coll->addAction("DebugLog", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &Log"), coll,
coll->addAction("DebugLog", new Action(KIcon("tools-report-bug"), tr("Debug &Log"), coll,
this, SLOT(on_actionDebugLog_triggered())));
coll->addAction("ReloadStyle", new Action(QIcon::fromTheme("view-refresh"), tr("Reload Stylesheet"), coll,
coll->addAction("ReloadStyle", new Action(KIcon("view-refresh"), tr("Reload Stylesheet"), coll,
QtUi::style(), SLOT(reload()), QKeySequence::Refresh));
coll->addAction("HideCurrentBuffer", new Action(tr("Hide Current Buffer"), coll,
this, SLOT(hideCurrentBuffer()), QKeySequence::Close));
// Help
QAction *aboutQuasselAct = new Action(KIcon("kuassel"), tr("&About Kuassel"), coll,
this, SLOT(showAboutDlg()));
aboutQuasselAct->setMenuRole(QAction::AboutRole);
coll->addAction("AboutQuassel", aboutQuasselAct);
// Navigation
coll = QtUi::actionCollection("Navigation", tr("Navigation"));
@ -425,13 +400,13 @@ void MainWin::setupActions()
QKeySequence(jumpModifier + Qt::Key_9)))->setProperty("Index", 9);
// Buffer navigation
coll->addAction("NextBufferView", new Action(QIcon::fromTheme("go-next-view"), tr("Activate Next Chat List"), coll,
coll->addAction("NextBufferView", new Action(KIcon("go-next-view"), tr("Activate Next Chat List"), coll,
this, SLOT(nextBufferView()), QKeySequence(QKeySequence::Forward)));
coll->addAction("PreviousBufferView", new Action(QIcon::fromTheme("go-previous-view"), tr("Activate Previous Chat List"), coll,
coll->addAction("PreviousBufferView", new Action(KIcon("go-previous-view"), tr("Activate Previous Chat List"), coll,
this, SLOT(previousBufferView()), QKeySequence::Back));
coll->addAction("NextBuffer", new Action(QIcon::fromTheme("go-down"), tr("Go to Next Chat"), coll,
coll->addAction("NextBuffer", new Action(KIcon("go-down"), tr("Go to Next Chat"), coll,
this, SLOT(nextBuffer()), QKeySequence(Qt::ALT + Qt::Key_Down)));
coll->addAction("PreviousBuffer", new Action(QIcon::fromTheme("go-up"), tr("Go to Previous Chat"), coll,
coll->addAction("PreviousBuffer", new Action(KIcon("go-up"), tr("Go to Previous Chat"), coll,
this, SLOT(previousBuffer()), QKeySequence(Qt::ALT + Qt::Key_Up)));
}
@ -481,11 +456,7 @@ void MainWin::setupMenus()
_settingsMenu->addAction(KStandardAction::keyBindings(this, SLOT(showShortcutsDlg()), this));
_settingsMenu->addAction(coll->action("ConfigureQuassel"));
_helpMenu = menuBar()->addMenu(tr("&Help"));
_helpMenu->addAction(coll->action("AboutQuassel"));
_helpMenu->addAction(KStandardAction::aboutKDE(_kHelpMenu, SLOT(aboutKDE()), this));
_helpMenu->addSeparator();
_helpDebugMenu = _helpMenu->addMenu(QIcon::fromTheme("tools-report-bug"), tr("Debug"));
_helpDebugMenu = menuBar()->addMenu(tr("&Tools"));
_helpDebugMenu->addAction(coll->action("DebugNetworkModel"));
_helpDebugMenu->addAction(coll->action("DebugBufferViewOverlay"));
_helpDebugMenu->addAction(coll->action("DebugMessageModel"));
@ -494,6 +465,11 @@ void MainWin::setupMenus()
_helpDebugMenu->addSeparator();
_helpDebugMenu->addAction(coll->action("ReloadStyle"));
_helpMenu = menuBar()->addMenu(tr("&Help"));
_helpMenu->addAction(coll->action("AboutQuassel"));
_helpMenu->addAction(KStandardAction::aboutKDE(_kHelpMenu, SLOT(aboutKDE()), this));
_helpMenu->addSeparator();
// Toggle visibility
QAction *showMenuBar = QtUi::actionCollection("General")->action("ToggleMenuBar");
@ -994,7 +970,6 @@ void MainWin::setConnectedState()
statusBar()->clearMessage();
_coreConnectionStatusWidget->setVisible(!Client::internalCore());
updateIcon();
systemTray()->setState(SystemTray::Active);
if (Client::networkIds().isEmpty()) {
@ -1091,7 +1066,6 @@ void MainWin::setDisconnectedState()
statusBar()->showMessage(tr("Not connected to core."));
if (_msgProcessorStatusWidget)
_msgProcessorStatusWidget->setProgress(0, 0);
updateIcon();
systemTray()->setState(SystemTray::Passive);
}
@ -1279,7 +1253,8 @@ void MainWin::showSettingsDlg()
void MainWin::showAboutDlg()
{
AboutDlg(this).exec();
KAboutApplicationDialog ad(KGlobal::mainComponent().aboutData(),this);
ad.exec();
}
@ -1468,7 +1443,7 @@ void MainWin::clientNetworkUpdated()
switch (net->connectionState()) {
case Network::Initialized:
action->setIcon(QIcon::fromTheme("network-connect"));
action->setIcon(KIcon("network-connect"));
// if we have no currently selected buffer, jump to the first connecting statusbuffer
if (!bufferWidget()->currentBuffer().isValid()) {
QModelIndex idx = Client::networkModel()->networkIndex(net->networkId());
@ -1479,10 +1454,10 @@ void MainWin::clientNetworkUpdated()
}
break;
case Network::Disconnected:
action->setIcon(QIcon::fromTheme("network-disconnect"));
action->setIcon(KIcon("network-disconnect"));
break;
default:
action->setIcon(QIcon::fromTheme("network-wired"));
action->setIcon(KIcon("network-wired"));
}
}

View file

@ -1,210 +0,0 @@
/***************************************************************************
* Copyright (C) 2005-2014 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <QFileDialog>
#include <QIcon>
#include <QUrl>
#include <phonon/mediaobject.h>
#include <phonon/backendcapabilities.h>
#include "phononnotificationbackend.h"
#include "clientsettings.h"
#include "mainwin.h"
#include "qtui.h"
PhononNotificationBackend::PhononNotificationBackend(QObject *parent)
: AbstractNotificationBackend(parent),
_media(0)
{
NotificationSettings notificationSettings;
notificationSettings.notify("Phonon/Enabled", this, SLOT(enabledChanged(const QVariant &)));
notificationSettings.notify("Phonon/AudioFile", this, SLOT(audioFileChanged(const QVariant &)));
createMediaObject(notificationSettings.value("Phonon/AudioFile", QString()).toString());
_enabled = notificationSettings.value("Phonon/Enabled", true).toBool();
_audioAvailable = !Phonon::BackendCapabilities::availableAudioOutputDevices().isEmpty();
}
PhononNotificationBackend::~PhononNotificationBackend()
{
if (_media)
delete _media;
}
void PhononNotificationBackend::notify(const Notification &notification)
{
if (_enabled && (notification.type == Highlight || notification.type == PrivMsg)) {
if (_audioAvailable && _media) {
_media->stop();
_media->play();
}
else
QApplication::beep();
}
}
void PhononNotificationBackend::close(uint notificationId)
{
Q_UNUSED(notificationId);
}
void PhononNotificationBackend::enabledChanged(const QVariant &v)
{
_enabled = v.toBool();
}
void PhononNotificationBackend::audioFileChanged(const QVariant &v)
{
createMediaObject(v.toString());
}
SettingsPage *PhononNotificationBackend::createConfigWidget() const
{
return new ConfigWidget();
}
void PhononNotificationBackend::createMediaObject(const QString &file)
{
if (_media)
delete _media;
if (file.isEmpty()) {
_media = 0;
return;
}
_media = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(QUrl::fromLocalFile(file)));
}
/***************************************************************************/
PhononNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent)
: SettingsPage("Internal", "PhononNotification", parent),
audioPreview(0)
{
ui.setupUi(this);
_audioAvailable = !Phonon::BackendCapabilities::availableAudioOutputDevices().isEmpty();
ui.enabled->setIcon(QIcon::fromTheme("media-playback-start"));
ui.play->setIcon(QIcon::fromTheme("media-playback-start"));
ui.open->setIcon(QIcon::fromTheme("document-open"));
connect(ui.enabled, SIGNAL(toggled(bool)), SLOT(widgetChanged()));
connect(ui.filename, SIGNAL(textChanged(const QString &)), SLOT(widgetChanged()));
}
PhononNotificationBackend::ConfigWidget::~ConfigWidget()
{
if (audioPreview)
delete audioPreview;
}
void PhononNotificationBackend::ConfigWidget::widgetChanged()
{
if (! _audioAvailable) {
ui.play->setEnabled(ui.enabled->isChecked());
ui.open->setEnabled(false);
ui.filename->setEnabled(false);
ui.filename->setText(QString());
}
else {
ui.play->setEnabled(ui.enabled->isChecked() && !ui.filename->text().isEmpty());
bool changed = (enabled != ui.enabled->isChecked() || filename != ui.filename->text());
if (changed != hasChanged())
setChangedState(changed);
}
}
bool PhononNotificationBackend::ConfigWidget::hasDefaults() const
{
return true;
}
void PhononNotificationBackend::ConfigWidget::defaults()
{
ui.enabled->setChecked(false);
ui.filename->setText(QString());
widgetChanged();
}
void PhononNotificationBackend::ConfigWidget::load()
{
NotificationSettings s;
enabled = s.value("Phonon/Enabled", false).toBool();
filename = s.value("Phonon/AudioFile", QString()).toString();
ui.enabled->setChecked(enabled);
ui.filename->setText(filename);
setChangedState(false);
}
void PhononNotificationBackend::ConfigWidget::save()
{
NotificationSettings s;
s.setValue("Phonon/Enabled", ui.enabled->isChecked());
s.setValue("Phonon/AudioFile", ui.filename->text());
load();
}
void PhononNotificationBackend::ConfigWidget::on_open_clicked()
{
QString file = QFileDialog::getOpenFileName(this, tr("Select Audio File"));
if (!file.isEmpty()) {
ui.filename->setText(file);
ui.play->setEnabled(true);
widgetChanged();
}
}
void PhononNotificationBackend::ConfigWidget::on_play_clicked()
{
if (_audioAvailable) {
if (!ui.filename->text().isEmpty()) {
if (audioPreview)
delete audioPreview;
audioPreview = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(QUrl::fromLocalFile(ui.filename->text())));
audioPreview->play();
}
}
else
QApplication::beep();
}

View file

@ -1,85 +0,0 @@
/***************************************************************************
* Copyright (C) 2005-2014 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef PHONONNOTIFICATIONBACKEND_H_
#define PHONONNOTIFICATIONBACKEND_H_
#include <phonon/mediaobject.h>
#include "abstractnotificationbackend.h"
#include "settingspage.h"
#include "ui_phononnotificationconfigwidget.h"
class PhononNotificationBackend : public AbstractNotificationBackend
{
Q_OBJECT
public:
PhononNotificationBackend(QObject *parent = 0);
~PhononNotificationBackend();
void notify(const Notification &);
void close(uint notificationId);
virtual SettingsPage *createConfigWidget() const;
private slots:
void enabledChanged(const QVariant &);
void audioFileChanged(const QVariant &);
void createMediaObject(const QString &name);
private:
class ConfigWidget;
bool _enabled;
bool _audioAvailable;
Phonon::MediaObject *_media;
};
class PhononNotificationBackend::ConfigWidget : public SettingsPage
{
Q_OBJECT
public:
ConfigWidget(QWidget *parent = 0);
~ConfigWidget();
void save();
void load();
bool hasDefaults() const;
void defaults();
private slots:
void widgetChanged();
void on_open_clicked();
void on_play_clicked();
private:
Ui::PhononNotificationConfigWidget ui;
bool enabled;
bool _audioAvailable;
QString filename;
Phonon::MediaObject *audioPreview;
};
#endif

View file

@ -20,7 +20,6 @@
#include "qtuiapplication.h"
#include <QIcon>
#include <QStringList>
#include <KStandardDirs>
@ -32,7 +31,7 @@
#include "qtuisettings.h"
QtUiApplication::QtUiApplication(int &argc, char **argv)
: KApplication(),
: KUniqueApplication(),
Quassel(),
_aboutToQuit(false)
{
@ -41,7 +40,7 @@ QtUiApplication::QtUiApplication(int &argc, char **argv)
// We need to setup KDE's data dirs
QStringList dataDirs = KGlobal::dirs()->findDirs("data", "");
for (int i = 0; i < dataDirs.count(); i++)
dataDirs[i].append("quassel/");
dataDirs[i].append("kuassel/");
dataDirs.append(":/data/");
setDataDirPaths(dataDirs);
@ -60,57 +59,6 @@ QtUiApplication::QtUiApplication(int &argc, char **argv)
bool QtUiApplication::init()
{
if (Quassel::init()) {
// FIXME: MIGRATION 0.3 -> 0.4: Move database and core config to new location
// Move settings, note this does not delete the old files
#ifdef Q_OS_MAC
QSettings newSettings("quassel-irc.org", "quasselclient");
#else
# ifdef Q_OS_WIN
QSettings::Format format = QSettings::IniFormat;
# else
QSettings::Format format = QSettings::NativeFormat;
# endif
QString newFilePath = Quassel::configDirPath() + "quasselclient"
+ ((format == QSettings::NativeFormat) ? QLatin1String(".conf") : QLatin1String(".ini"));
QSettings newSettings(newFilePath, format);
#endif /* Q_OS_MAC */
if (newSettings.value("Config/Version").toUInt() == 0) {
# ifdef Q_OS_MAC
QString org = "quassel-irc.org";
# else
QString org = "Quassel Project";
# endif
QSettings oldSettings(org, "Quassel Client");
if (oldSettings.allKeys().count()) {
qWarning() << "\n\n*** IMPORTANT: Config and data file locations have changed. Attempting to auto-migrate your client settings...";
foreach(QString key, oldSettings.allKeys())
newSettings.setValue(key, oldSettings.value(key));
newSettings.setValue("Config/Version", 1);
qWarning() << "* Your client settings have been migrated to" << newSettings.fileName();
qWarning() << "*** Migration completed.\n\n";
}
}
// MIGRATION end
// check settings version
// so far, we only have 1
QtUiSettings s;
if (s.version() != 1) {
qCritical() << "Invalid client settings version, terminating!";
return false;
}
// Set the icon theme
if (Quassel::isOptionSet("icontheme"))
QIcon::setThemeName(Quassel::optionValue("icontheme"));
else if (QIcon::themeName().isEmpty())
// Some platforms don't set a default icon theme; chances are we can find our bundled Oxygen theme though
QIcon::setThemeName("oxygen");
// session resume
QtUi *gui = new QtUi();
Client::init(gui);

View file

@ -21,7 +21,7 @@
#ifndef QTUIAPPLICATION_H_
#define QTUIAPPLICATION_H_
# include <KApplication>
#include <KUniqueApplication>
#include <QSessionManager>
@ -30,7 +30,7 @@
class QtUi;
class QtUiApplication : public KApplication, public Quassel
class QtUiApplication : public KUniqueApplication, public Quassel
{
Q_OBJECT

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