From: Manuel Nickschas Date: Wed, 17 May 2006 21:53:53 +0000 (+0000) Subject: Initial checkin of first CMake based version. X-Git-Tag: 0.1.0~296 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=925b072e5c7bc38949995902cf7af6e4644c2c55 Initial checkin of first CMake based version. --- diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..255d5fd8 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,54 @@ +PROJECT(Quassel) + +# Select if Quassel should be built in client, server or monolithic mode +SET(BUILD "mono" CACHE STRING "Defines which Quassel parts are to be built. Can contain 'server', 'client' and/or 'monolithic' (which is the default).") +SET(BUILD_SERVER ) +SET(BUILD_CLIENT ) +SET(BUILD_MONO ) +IF(BUILD MATCHES "server") + SET(BUILD_SERVER true) + MESSAGE(STATUS "Building Quassel server.") +ENDIF(BUILD MATCHES "server") +IF(BUILD MATCHES "client") + SET(BUILD_CLIENT true) + MESSAGE(STATUS "Building Quassel client.") +ENDIF(BUILD MATCHES "client") +IF(BUILD MATCHES "mono") + SET(BUILD_MONO true) + MESSAGE(STATUS "Building monolithic Quassel.") +ENDIF(BUILD MATCHES "mono") +IF(NOT BUILD_MONO AND NOT BUILD_SERVER AND NOT BUILD_CLIENT) + MESSAGE(FATAL_ERROR "You have not selected which parts of Quassel I should build. Aborting.\nRun 'cmake -DBUILD=', where contains one or more of 'server', 'client' or 'monolithic'.") +ENDIF(NOT BUILD_MONO AND NOT BUILD_SERVER AND NOT BUILD_CLIENT) + +# We need Qt4 support. +FIND_PACKAGE(Qt4 REQUIRED) + +# Set needed libraries +SET(QT_USE_QTXML true) +IF(NOT BUILD_CLIENT AND NOT BUILD_MONO) + SET(QT_DONT_USE_QTGUI true) + MESSAGE(STATUS "Disabling GUI support.") +ENDIF(NOT BUILD_CLIENT AND NOT BUILD_MONO) +INCLUDE(${QT_USE_FILE}) +ADD_DEFINITIONS(${QT_DEFINITIONS}) + +# Define files +SET(quassel_SRCS main/main.cpp) +SET(quassel_RCCS images/icons.qrc) +SET(quassel_DIRS gui main) + +# Build correct absolute paths for subdirs to include +SET(SDIRS "") +FOREACH(dir ${quassel_DIRS}) + SET(SDIRS ${SDIRS} "${CMAKE_CURRENT_SOURCE_DIR}/${dir}") +ENDFOREACH(dir) +INCLUDE_DIRECTORIES(${SDIRS} ${QT_INCLUDES}) + +ADD_SUBDIRECTORY(gui) +ADD_SUBDIRECTORY(main) + +QT4_ADD_RESOURCES(_RCCS ${quassel_RCCS}) + +ADD_EXECUTABLE(quasselbin ${quassel_SRCS} ${_RCCS}) +TARGET_LINK_LIBRARIES(quasselbin main gui ${QT_LIBRARIES}) diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..5b6e7c66 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 00000000..e5598415 --- /dev/null +++ b/Doxyfile @@ -0,0 +1,275 @@ +# Doxyfile 1.4.1-KDevelop + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = quassel.kdevelop +PROJECT_NUMBER = 0.1 +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +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 = YES +INLINE_INHERITED_MEMB = YES +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = / +STRIP_FROM_INC_PATH = +SHORT_NAMES = YES +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = YES +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = NO +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = YES +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 = NO +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 = /home/sputnick/devel/quassel +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 = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = NO +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +VERBATIM_HEADERS = NO +#--------------------------------------------------------------------------- +# 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 +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +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 = yes +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 = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = quassel.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +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 +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt new file mode 100644 index 00000000..1177e965 --- /dev/null +++ b/gui/CMakeLists.txt @@ -0,0 +1,9 @@ +SET(gui_SRCS channelwidget.cpp mainwin.cpp serverlist.cpp) +SET(gui_HDRS ) +SET(gui_MOCS channelwidget.h mainwin.h serverlist.h) +SET(gui_UICS channelwidget.ui identitiesdlg.ui identitieseditdlg.ui networkeditdlg.ui nickeditdlg.ui serverlistdlg.ui) + +QT4_WRAP_UI(_UIC ${gui_UICS}) +QT4_WRAP_CPP(_MOC ${gui_MOCS}) + +ADD_LIBRARY(gui ${_UIC} ${_MOC} ${gui_HDRS} ${gui_SRCS}) diff --git a/gui/channelwidget.cpp b/gui/channelwidget.cpp new file mode 100644 index 00000000..d9851cd2 --- /dev/null +++ b/gui/channelwidget.cpp @@ -0,0 +1,40 @@ +/*************************************************************************** + * Copyright (C) 2005 by The Quassel Team * + * 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) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "channelwidget.h" + +#include +#include + +ChannelWidget::ChannelWidget(QWidget *parent) : QWidget(parent) { + ui.setupUi(this); + ui.lineEdit->setText("foobar"); + + //ui.splitter-> + ui.textBrowser->setHtml("[17:21] --> Dante has joined #quassel (~hurz@p1af2242.dip.t-dialin.net)
" + "[17:21] --> Sput has joined #quassel (~Sput42@vincent.mindpool.net)
" + "[17:23] <Dante> Das sieht ja soweit schonmal Klasse aus!
" + "[17:23] <Sput> Find ich auch... schade dass es noch nix tut :p
" + "[17:24] <Dante> Das wird sich ja gottseidank bald ändern.
" + "[17:24] <Sput> Wollen wir's hoffen :D" + ); + ui.listWidget->addItem("@Dante"); + ui.listWidget->addItem("@Sput"); +} diff --git a/gui/channelwidget.h b/gui/channelwidget.h new file mode 100644 index 00000000..3d36cf85 --- /dev/null +++ b/gui/channelwidget.h @@ -0,0 +1,37 @@ +/*************************************************************************** + * Copyright (C) 2005 by The Quassel Team * + * 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) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _CHANNELWIDGET_H_ +#define _CHANNELWIDGET_H_ + +#include "ui_channelwidget.h" + +class ChannelWidget : public QWidget { + Q_OBJECT + + public: + ChannelWidget(QWidget *parent = 0); + + private: + Ui::ChannelWidget ui; +}; + + +#endif diff --git a/gui/channelwidget.ui b/gui/channelwidget.ui new file mode 100644 index 00000000..3905977b --- /dev/null +++ b/gui/channelwidget.ui @@ -0,0 +1,112 @@ + + + + + ChannelWidget + + + + 0 + 0 + 550 + 243 + + + + + 16 + 16 + + + + #quassel + + + + 8 + + + 6 + + + + + Qt::Horizontal + + + + 8 + + + 6 + + + + + + 7 + 7 + 4 + 0 + + + + + + + 7 + 7 + 1 + 0 + + + + + 75 + 0 + + + + + 4000 + 4000 + + + + + + + + + + + + + -10 + 20 + 530 + 192 + + + + Qt::Horizontal + + + + + + 10 + 10 + 518 + 52 + + + + Qt::Horizontal + + + + + + + diff --git a/gui/identitiesdlg.ui b/gui/identitiesdlg.ui new file mode 100644 index 00000000..d994b8ac --- /dev/null +++ b/gui/identitiesdlg.ui @@ -0,0 +1,700 @@ + + + + + IdentitiesDlg + + + + 0 + 0 + 383 + 390 + + + + + 5 + 5 + 0 + 0 + + + + Edit Identity + + + :/default/identity.png + + + true + + + + 8 + + + 6 + + + + + 0 + + + 6 + + + + + + 3 + 0 + 0 + 0 + + + + QComboBox::NoInsert + + + + + + + Edit... + + + :/default/edit_user.png + + + + + + + + + + &General + + + + 8 + + + 6 + + + + + 0 + + + 6 + + + + + Real Name + + + + + + + + + + + + + Ident + + + + + + + + + Nicknames + + + + 8 + + + 6 + + + + + + 7 + 7 + 1 + 0 + + + + + + + + 0 + + + 6 + + + + + + 5 + 0 + 0 + 0 + + + + &Add... + + + :/default/edit_add.png + + + + 16 + 16 + + + + + + + + + 5 + 0 + 0 + 0 + + + + &Edit... + + + :/default/edit.png + + + + + + + + 5 + 0 + 0 + 0 + + + + De&lete + + + :/default/edit_remove.png + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + ... + + + :/default/1uparrow.png + + + + + + + ... + + + :/default/1downarrow.png + + + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + + + + + + 10 + 0 + 395 + 83 + + + + + + + &Away + + + + 8 + + + 6 + + + + + 0 + + + 6 + + + + + + + + Away Reason + + + + + + + + + + Return Message + + + + + + + + + + Away Nick + + + + + + + + + Auto Away + + + + 8 + + + 6 + + + + + Enable Auto Away + + + + + + + 0 + + + 6 + + + + + Auto away after + + + + + + + + + + minutes + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + 6 + + + + + Return Message + + + + + + + Away Reason + + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + &Messages + + + + 8 + + + 6 + + + + + 0 + + + 6 + + + + + Part Reason + + + + + + + + + + + + + Quit Reason + + + + + + + + + + Kick Reason + + + + + + + + + Qt::Vertical + + + + 20 + 141 + + + + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + OK + + + :/default/button_ok.png + + + + + + + Cancel + + + :/default/button_cancel.png + + + + + + + + + + + + + + okButton + clicked() + IdentitiesDlg + accept() + + + 356 + 372 + + + 96 + 254 + + + + + cancelButton + clicked() + IdentitiesDlg + reject() + + + 447 + 372 + + + 179 + 282 + + + + + enableAwayNick + clicked(bool) + awayNickEdit + setEnabled(bool) + + + 71 + 84 + + + 212 + 84 + + + + + enableAwayReason + clicked(bool) + awayReasonEdit + setEnabled(bool) + + + 111 + 117 + + + 153 + 116 + + + + + enableReturnMessage + clicked(bool) + returnMessageEdit + setEnabled(bool) + + + 120 + 145 + + + 166 + 145 + + + + + enableAutoAway + clicked(bool) + autoAwayTime + setEnabled(bool) + + + 79 + 202 + + + 144 + 230 + + + + + enableAutoAwayReturn + clicked(bool) + autoAwayReturnEdit + setEnabled(bool) + + + 121 + 284 + + + 202 + 291 + + + + + enableAutoAwayReason + clicked(bool) + autoAwayReasonEdit + setEnabled(bool) + + + 140 + 261 + + + 169 + 261 + + + + + diff --git a/gui/identitieseditdlg.ui b/gui/identitieseditdlg.ui new file mode 100644 index 00000000..9835e43c --- /dev/null +++ b/gui/identitieseditdlg.ui @@ -0,0 +1,167 @@ + + + + + IdentitiesEditDlg + + + + 0 + 0 + 382 + 235 + + + + Edit Identities + + + true + + + + 8 + + + 6 + + + + + 0 + + + 6 + + + + + + + + 0 + + + 6 + + + + + &Add... + + + + + + + &Duplicate... + + + + + + + &Rename... + + + + + + + De&lete + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + &OK + + + + + + + &Cancel + + + + + + + + + + + + okButton + clicked() + IdentitiesEditDlg + accept() + + + 278 + 253 + + + 96 + 254 + + + + + cancelButton + clicked() + IdentitiesEditDlg + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/gui/mainwin.cpp b/gui/mainwin.cpp new file mode 100644 index 00000000..4dd5d280 --- /dev/null +++ b/gui/mainwin.cpp @@ -0,0 +1,87 @@ +/*************************************************************************** + * Copyright (C) 2005 by The Quassel Team * + * 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) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include + +#include "mainwin.h" +#include "channelwidget.h" +#include "serverlist.h" + +MainWin::MainWin() : QMainWindow() { + + setWindowTitle("Quassel IRC"); + setWindowIcon(QIcon(":/default/tux.png")); + setWindowIconText("Quassel IRC"); + workspace = new QWorkspace(this); + setCentralWidget(workspace); + ChannelWidget *cw = new ChannelWidget(this); + workspace->addWindow(cw); + //setCentralWidget(cw); + serverListDlg = new ServerListDlg(this); + serverListDlg->setVisible(serverListDlg->showOnStartup()); + //showServerList(); + + setupMenus(); + statusBar()->showMessage(tr("Ready")); + +} + +void MainWin::setupMenus() { + fileMenu = menuBar()->addMenu(tr("&File")); + serverListAct = fileMenu->addAction(QIcon(":/default/server.png"), tr("&Server List..."), this, SLOT(showServerList()), tr("F7")); + fileMenu->addSeparator(); + quitAct = fileMenu->addAction(QIcon(":/default/exit.png"), tr("&Quit"), qApp, SLOT(quit()), tr("CTRL+Q")); + + editMenu = menuBar()->addMenu(tr("&Edit")); + editMenu->setEnabled(0); + + ircMenu = menuBar()->addMenu(tr("&IRC")); + ircMenu->setEnabled(0); + + serverMenu = menuBar()->addMenu(tr("Ser&ver")); + serverMenu->setEnabled(0); + + windowMenu = menuBar()->addMenu(tr("&Window")); + windowMenu->setEnabled(0); + + settingsMenu = menuBar()->addMenu(tr("&Settings")); + identitiesAct = settingsMenu->addAction(QIcon(":/default/identity.png"), tr("&Identities..."), serverListDlg, SLOT(editIdentities())); + settingsMenu->addSeparator(); + configAct = settingsMenu->addAction(QIcon(":/default/configure.png"), tr("&Configure Quassel...")); + configAct->setEnabled(0); + + helpMenu = menuBar()->addMenu(tr("&Help")); + aboutAct = helpMenu->addAction(tr("&About")); + aboutAct->setEnabled(0); + aboutQtAct = helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt())); + + + //toolBar = new QToolBar("Test", this); + //toolBar->addAction(identitiesAct); + //addToolBar(Qt::TopToolBarArea, toolBar); +} + +void MainWin::showServerList() { +// if(!serverListDlg) { +// serverListDlg = new ServerListDlg(this); +// } + serverListDlg->show(); +} + diff --git a/gui/mainwin.h b/gui/mainwin.h new file mode 100644 index 00000000..6ca7f248 --- /dev/null +++ b/gui/mainwin.h @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (C) 2005 by The Quassel Team * + * 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) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _MAINWIN_H_ +#define _MAINWIN_H_ + +#include + +class QMenu; +class QWorkspace; + +class ServerListDlg; + +class MainWin : public QMainWindow { + Q_OBJECT + + public: + MainWin(); + + protected: + + private slots: + void showServerList(); + + private: + void setupMenus(); + + QWorkspace *workspace; + QToolBar *toolBar; + QMenu *fileMenu, *editMenu, *ircMenu, *serverMenu, *windowMenu, *helpMenu, *settingsMenu; + QAction *quitAct, *serverListAct; + QAction *aboutAct, *aboutQtAct; + QAction *identitiesAct, *configAct; + + ServerListDlg *serverListDlg; +}; + +#endif diff --git a/gui/networkeditdlg.ui b/gui/networkeditdlg.ui new file mode 100644 index 00000000..3b1b5be2 --- /dev/null +++ b/gui/networkeditdlg.ui @@ -0,0 +1,327 @@ + + + + + NetworkEditDlg + + + + 0 + 0 + 434 + 458 + + + + Edit Network Settings + + + + 8 + + + 6 + + + + + 0 + + + 6 + + + + + Identity: + + + + + + + Network: + + + + + + + + + + 0 + + + 6 + + + + + + + + + 4 + 0 + 0 + 0 + + + + Edit... + + + + + + + + + QComboBox::NoInsert + + + + + + + Group: + + + + + + + + + Auto-connect at startup + + + + + + + + Servers + + + + 8 + + + 6 + + + + + 0 + + + 6 + + + + + + + + 0 + + + 6 + + + + + &Add... + + + + + + + &Edit... + + + + + + + De&lete + + + + + + + Move &Up + + + + + + + Move &Down + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + 230 + 20 + 87 + 151 + + + + + + + Perform + + + + 8 + + + 6 + + + + + 0 + + + 6 + + + + + + + + These commands are executed after connect. + + + + + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 275 + 31 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + + 10 + 110 + 461 + 331 + + + + + + + 11 + 407 + 459 + 33 + + + + + + + + + okButton + clicked() + NetworkEditDlg + accept() + + + 278 + 253 + + + 96 + 254 + + + + + cancelButton + clicked() + NetworkEditDlg + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/gui/nickeditdlg.ui b/gui/nickeditdlg.ui new file mode 100644 index 00000000..01deb7f5 --- /dev/null +++ b/gui/nickeditdlg.ui @@ -0,0 +1,144 @@ + + + + + NickEditDlg + + + + 0 + 0 + 307 + 96 + + + + + 3 + 3 + 0 + 0 + + + + Edit Nick + + + true + + + + 8 + + + 6 + + + + + Nickname: + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + + 9 + 32 + 325 + 25 + + + + + + + + + okButton + clicked() + NickEditDlg + accept() + + + 278 + 253 + + + 96 + 254 + + + + + cancelButton + clicked() + NickEditDlg + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/gui/serverlist.cpp b/gui/serverlist.cpp new file mode 100644 index 00000000..221eb2a5 --- /dev/null +++ b/gui/serverlist.cpp @@ -0,0 +1,556 @@ +/*************************************************************************** + * Copyright (C) 2005 by The Quassel Team * + * 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) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "serverlist.h" + +/* NOTE: This dialog holds not only the server list, but also the identities. + * This makes perfect sense given the fact that connections are initiated from + * this dialog, and that the dialog exists during the lifetime of the program. + * This data is also only used from within the GUI, which means it shouldn't be + * part of the global Quassel class (me thinks). + */ + +ServerListDlg::ServerListDlg(QWidget *parent) : QDialog(parent) { + ui.setupUi(this); + + QSettings settings; + settings.beginGroup("Network"); + ui.showOnStartup->setChecked(settings.value("ShowServerListOnStartup", true).toBool()); + // create some default entries + VarMap s1, s2, s3, s4; + + s1["group"] = "Private Servers"; + networks["mindNet"] = s1; + s2["group"] = "Private Servers"; + networks["fooBar"] = s2; + s3["group"] = ""; + networks["Single"] = s3; + s4["group"] = "Public Servers"; + networks["public"] = s4; + + // load networks from QSettings here instead + // [...] + + // Construct tree widget (and its items) from networks + QStringList headers; + headers << "Network" << "Autoconnect"; + ui.networkTree->setHeaderLabels(headers); + QHash groups; + foreach(QString net, networks.keys()) { + VarMap s = networks[net].toMap(); + QString gr = s["group"].toString(); + QTreeWidgetItem *item = 0; + if(gr == "") { + item = new QTreeWidgetItem(ui.networkTree); + } else { + if(groups.contains(gr)) { + item = new QTreeWidgetItem(groups[gr]); + } else { + QTreeWidgetItem *newgr = new QTreeWidgetItem(ui.networkTree); + newgr->setText(0, gr); + newgr->setFlags(newgr->flags() & ~Qt::ItemIsSelectable); + ui.networkTree->expandItem(newgr); + groups[gr] = newgr; + item = new QTreeWidgetItem(newgr); + } + } + item->setText(0, net); + //item->setFlags(item->flags() | Qt::ItemIsUserCheckable); + item->setCheckState(1, Qt::Unchecked); + } + connect(ui.networkTree, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons())); + + loadIdentities(); + settings.endGroup(); +} + +ServerListDlg::~ServerListDlg() { + +} + +void ServerListDlg::updateButtons() { + QList selected = ui.networkTree->selectedItems(); + ui.editButton->setEnabled(selected.size() == 1); + ui.deleteButton->setEnabled(selected.size() >= 1); + ui.connectButton->setEnabled(selected.size() >= 1); + +} + +bool ServerListDlg::showOnStartup() { + return ui.showOnStartup->isChecked(); +} + +void ServerListDlg::on_addButton_clicked() { + NetworkEditDlg dlg(this, VarMap(), identities); + if(dlg.exec() == QDialog::Accepted) { + + } +} + +void ServerListDlg::loadNetworks() { + +} + +void ServerListDlg::storeNetworks() { + +} + +void ServerListDlg::loadIdentities() { + QSettings s; + //s.beginGroup("Identities"); + identities = s.value("Network/Identities").toMap(); + while(!identities.contains("Default")) { + identities = VarMap(); + editIdentities(); + } +} + +void ServerListDlg::storeIdentities() { + QSettings s; + s.setValue("Network/Identities", identities); +} + +void ServerListDlg::editIdentities() { + IdentitiesDlg dlg(this, identities); + if(dlg.exec() == QDialog::Accepted) { + identities = dlg.getIdentities(); + QMap mapping = dlg.getNameMapping(); + // add mapping here + + // + storeIdentities(); + storeNetworks(); // ? how to treat mapping and NOT save changes not yet applied to the server list? + } +} + +void ServerListDlg::on_showOnStartup_stateChanged(int) { + QSettings s; + s.setValue("Network/ShowServerListOnStartup", ui.showOnStartup->isChecked()); +} + +/***************************************************************************/ + +NetworkEditDlg::NetworkEditDlg(QWidget *parent, VarMap _network, VarMap _identities) : QDialog(parent) { + ui.setupUi(this); + network = _network; + identities = _identities; + + ui.identityList->addItem(tr("Default Identity")); + + foreach(QString id, identities.keys()) { + if(id != "Default") ui.identityList->addItem(id); + } + +} + +VarMap NetworkEditDlg::createDefaultNetwork() { + VarMap net; + + net["group"] = ""; + + return net; +} + +/***************************************************************************/ + +IdentitiesDlg::IdentitiesDlg(QWidget *parent, VarMap _identities) : QDialog(parent) { + ui.setupUi(this); + connect(ui.enableAutoAway, SIGNAL(stateChanged(int)), this, SLOT(autoAwayChecked())); + + identities = _identities; + foreach(QString name, identities.keys()) { + nameMapping[name] = name; + } + if(identities.size() == 0) { + VarMap id = createDefaultIdentity(); + id["IdName"] = "Default"; + identities["Default"] = id; + } + ui.identityList->addItem(tr("Default Identity")); + + foreach(QString id, identities.keys()) { + if(id != "Default") ui.identityList->addItem(id); + } + updateWidgets(); + lastIdentity = getCurIdentity(); + connect(ui.identityList, SIGNAL(activated(QString)), this, SLOT(identityChanged(QString))); + connect(ui.editIdentitiesButton, SIGNAL(clicked()), this, SLOT(editIdentities())); + connect(ui.nickList, SIGNAL(itemSelectionChanged()), this, SLOT(nickSelectionChanged())); + connect(ui.addNickButton, SIGNAL(clicked()), this, SLOT(addNick())); + connect(ui.editNickButton, SIGNAL(clicked()), this, SLOT(editNick())); + connect(ui.delNickButton, SIGNAL(clicked()), this, SLOT(delNick())); + connect(ui.upNickButton, SIGNAL(clicked()), this, SLOT(upNick())); + connect(ui.downNickButton, SIGNAL(clicked()), this, SLOT(downNick())); +} + +VarMap IdentitiesDlg::createDefaultIdentity() { + VarMap id; + id["RealName"] = "foo"; + id["Ident"] = ""; + id["NickList"] = QStringList(); + id["enableAwayNick"] = false; + id["AwayNick"] = ""; + id["enableAwayReason"] = false; + id["AwayReason"] = ""; + id["enableReturnMessage"] = false; + id["ReturnMessage"] = ""; + id["enableAutoAway"] = false; + id["AutoAwayTime"] = 10; + id["enableAutoAwayReason"] = false; + id["AutoAwayReason"] = ""; + id["enableAutoAwayReturn"] = false; + id["AutoAwayReturn"] = ""; + id["PartReason"] = "Quasseling elsewhere."; + id["QuitReason"] = "Every Quassel comes to its end."; + id["KickReason"] = "No more quasseling for you!"; + + return id; +} + +QString IdentitiesDlg::getCurIdentity() { + if(ui.identityList->currentIndex() == 0) return "Default"; + return ui.identityList->currentText(); +} + +void IdentitiesDlg::updateWidgets() { + VarMap id = identities[getCurIdentity()].toMap(); + ui.realNameEdit->setText(id["RealName"].toString()); + ui.identEdit->setText(id["Ident"].toString()); + ui.nickList->clear(); + ui.nickList->addItems(id["NickList"].toStringList()); + if(ui.nickList->count()>0) ui.nickList->setCurrentRow(0); + ui.enableAwayNick->setChecked(id["enableAwayNick"].toBool()); + ui.awayNickEdit->setText(id["AwayNick"].toString()); + ui.awayNickEdit->setEnabled(ui.enableAwayNick->isChecked()); + ui.enableAwayReason->setChecked(id["enableAwayReason"].toBool()); + ui.awayReasonEdit->setText(id["AwayReason"].toString()); + ui.awayReasonEdit->setEnabled(ui.enableAwayReason->isChecked()); + ui.enableReturnMessage->setChecked(id["enableReturnMessage"].toBool()); + ui.returnMessageEdit->setText(id["ReturnMessage"].toString()); + ui.returnMessageEdit->setEnabled(ui.enableReturnMessage->isChecked()); + ui.enableAutoAway->setChecked(id["enableAutoAway"].toBool()); + ui.autoAwayTime->setValue(id["AutoAwayTime"].toInt()); + ui.enableAutoAwayReason->setChecked(id["enableAutoAwayReason"].toBool()); + ui.autoAwayReasonEdit->setText(id["AutoAwayReason"].toString()); + ui.enableAutoAwayReturn->setChecked(id["enableAutoAwayReturn"].toBool()); + ui.autoAwayReturnEdit->setText(id["AutoAwayReturn"].toString()); + ui.partReasonEdit->setText(id["PartReason"].toString()); + ui.kickReasonEdit->setText(id["KickReason"].toString()); + ui.quitReasonEdit->setText(id["QuitReason"].toString()); + // set enabled states correctly + autoAwayChecked(); + nickSelectionChanged(); +} + +void IdentitiesDlg::updateIdentity(QString idName) { + VarMap id; + id["RealName"] = ui.realNameEdit->text(); + id["Ident"] = ui.identEdit->text(); + QStringList nicks; + for(int i = 0; i < ui.nickList->count(); i++) nicks << ui.nickList->item(i)->text(); + id["NickList"] = nicks; + id["enableAwayNick"] = ui.enableAwayNick->isChecked(); + id["AwayNick"] = ui.awayNickEdit->text(); + id["enableAwayReason"] = ui.enableAwayReason->isChecked(); + id["AwayReason"] = ui.awayReasonEdit->text(); + id["enableReturnMessage"] = ui.enableReturnMessage->isChecked(); + id["ReturnMessage"] = ui.returnMessageEdit->text(); + id["enableAutoAway"] = ui.enableAutoAway->isChecked(); + id["AutoAwayTime"] = ui.autoAwayTime->value(); + id["enableAutoAwayReason"] = ui.enableAutoAwayReason->isChecked(); + id["AutoAwayReason"] = ui.autoAwayReasonEdit->text(); + id["enableAutoAwayReturn"] = ui.enableAutoAwayReturn->isChecked(); + id["AutoAwayReturn"] = ui.autoAwayReturnEdit->text(); + id["PartReason"] = ui.partReasonEdit->text(); + id["KickReason"] = ui.kickReasonEdit->text(); + id["QuitReason"] = ui.quitReasonEdit->text(); + + id["IdName"] = idName; + identities[idName] = id; +} + +void IdentitiesDlg::identityChanged(QString) { + updateIdentity(lastIdentity); + lastIdentity = getCurIdentity(); + updateWidgets(); +} + +void IdentitiesDlg::autoAwayChecked() { + if(ui.enableAutoAway->isChecked()) { + ui.autoAwayLabel_1->setEnabled(1); + ui.autoAwayLabel_2->setEnabled(1); + ui.autoAwayTime->setEnabled(1); + ui.enableAutoAwayReason->setEnabled(1); + ui.enableAutoAwayReturn->setEnabled(1); + ui.autoAwayReasonEdit->setEnabled(ui.enableAutoAwayReason->isChecked()); + ui.autoAwayReturnEdit->setEnabled(ui.enableAutoAwayReturn->isChecked()); + } else { + ui.autoAwayLabel_1->setEnabled(0); + ui.autoAwayLabel_2->setEnabled(0); + ui.autoAwayTime->setEnabled(0); + ui.enableAutoAwayReason->setEnabled(0); + ui.enableAutoAwayReturn->setEnabled(0); + ui.autoAwayReasonEdit->setEnabled(0); + ui.autoAwayReturnEdit->setEnabled(0); + } +} + +void IdentitiesDlg::nickSelectionChanged() { + int curidx = ui.nickList->currentRow(); + ui.editNickButton->setEnabled(curidx >= 0); + ui.delNickButton->setEnabled(curidx >= 0); + ui.upNickButton->setEnabled(curidx > 0); + ui.downNickButton->setEnabled(curidx >= 0 && curidx < ui.nickList->count() - 1); +} + +void IdentitiesDlg::addNick() { + NickEditDlg dlg(this); + if(dlg.exec() == QDialog::Accepted) { + QListWidgetItem *item = new QListWidgetItem(ui.nickList); + item->setText(dlg.getNick()); + item->setFlags(item->flags() | Qt::ItemIsEditable); + ui.nickList->setCurrentItem(item); + nickSelectionChanged(); + } +} + +void IdentitiesDlg::editNick() { + NickEditDlg dlg(this, ui.nickList->currentItem()->text()); + if(dlg.exec() == QDialog::Accepted) { + ui.nickList->currentItem()->setText(dlg.getNick()); + } +} + +void IdentitiesDlg::delNick() { + int row = ui.nickList->currentRow(); + delete ui.nickList->takeItem(row); + if(row <= ui.nickList->count() - 1) ui.nickList->setCurrentRow(row); + else if(row > 0) ui.nickList->setCurrentRow(ui.nickList->count()-1); + nickSelectionChanged(); +} + +void IdentitiesDlg::upNick() { + int row = ui.nickList->currentRow(); + QListWidgetItem *item = ui.nickList->takeItem(row); + ui.nickList->insertItem(row-1, item); + ui.nickList->setCurrentRow(row-1); + nickSelectionChanged(); +} + +void IdentitiesDlg::downNick() { + int row = ui.nickList->currentRow(); + QListWidgetItem *item = ui.nickList->takeItem(row); + ui.nickList->insertItem(row+1, item); + ui.nickList->setCurrentRow(row+1); + nickSelectionChanged(); +} + +void IdentitiesDlg::accept() { + updateIdentity(getCurIdentity()); + QString result = checkValidity(); + if(result.length() == 0) QDialog::accept(); + else { + QMessageBox::warning(this, tr("Invalid Identity!"), + tr("One or more of your identities do not contain all necessary information:\n\n%1\n" + "Please fill in any missing information.").arg(result)); + } +} + +QString IdentitiesDlg::checkValidity() { + QString reason; + foreach(QString name, identities.keys()) { + QString r; + VarMap id = identities[name].toMap(); + if(name == "Default") name = tr("Default Identity"); + if(id["RealName"].toString().length() == 0) { + r += tr(" You have not set a real name."); + } + if(id["Ident"].toString().length() == 0) { + r += tr(" You have to specify an Ident."); + } + if(id["NickList"].toStringList().size() == 0) { + r += tr(" You haven't entered any nicknames."); + } + if(r.length()>0) { + reason += tr("[%1]%2\n").arg(name).arg(r); + } + } + return reason; +} + +void IdentitiesDlg::editIdentities() { + updateIdentity(getCurIdentity()); + IdentitiesEditDlg dlg(this, identities, nameMapping, createDefaultIdentity()); + if(dlg.exec() == QDialog::Accepted) { + identities = dlg.getIdentities(); + nameMapping = dlg.getMapping(); + ui.identityList->clear(); + ui.identityList->addItem(tr("Default Identity")); + foreach(QString id, identities.keys()) { + if(id != "Default") ui.identityList->addItem(id); + } + lastIdentity = getCurIdentity(); + updateWidgets(); + } +} + +/******************************************************************************/ + +IdentitiesEditDlg::IdentitiesEditDlg(QWidget *parent, VarMap _identities, QMap _mapping, VarMap templ) + : QDialog(parent) { + ui.setupUi(this); + identities = _identities; + mapping = _mapping; + identTemplate = templ; + + foreach(QString name, identities.keys()) { + if(name == "Default") continue; + ui.identList->addItem(name); + } + ui.identList->sortItems(); + ui.identList->insertItem(0, tr("Default Identity")); + ui.identList->setCurrentRow(0); + selectionChanged(); + connect(ui.identList, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged())); + connect(ui.addButton, SIGNAL(clicked()), this, SLOT(addIdentity())); + connect(ui.duplicateButton, SIGNAL(clicked()), this, SLOT(duplicateIdentity())); + connect(ui.renameButton, SIGNAL(clicked()), this, SLOT(renameIdentity())); + connect(ui.deleteButton, SIGNAL(clicked()), this, SLOT(deleteIdentity())); +} + +void IdentitiesEditDlg::selectionChanged() { + int idx = ui.identList->currentRow(); + ui.duplicateButton->setEnabled(idx >= 0); + ui.renameButton->setEnabled(idx > 0); + ui.deleteButton->setEnabled(idx > 0); + +} + +void IdentitiesEditDlg::addIdentity() { + RenameIdentityDlg dlg(this, identities.keys()); + if(dlg.exec() == QDialog::Accepted) { + VarMap id = identTemplate; + identities[dlg.getName()] = id; + QListWidgetItem *item = new QListWidgetItem(dlg.getName(), ui.identList); + sortList(); + ui.identList->setCurrentItem(item); + selectionChanged(); + } +} + +void IdentitiesEditDlg::duplicateIdentity() { + RenameIdentityDlg dlg(this, identities.keys()); + if(dlg.exec() == QDialog::Accepted) { + QString curname = ui.identList->currentRow() == 0 ? "Default" : ui.identList->currentItem()->text(); + QVariant id = identities[curname]; + identities[dlg.getName()] = id; + QListWidgetItem *item = new QListWidgetItem(dlg.getName(), ui.identList); + sortList(); + ui.identList->setCurrentItem(item); + selectionChanged(); + } +} + +void IdentitiesEditDlg::renameIdentity() { + QList names; + QString curname = ui.identList->currentItem()->text(); + foreach(QString n, identities.keys()) { + if(n != curname) names.append(n); + } + RenameIdentityDlg dlg(this, names, curname); + if(dlg.exec() == QDialog::Accepted) { + QString newname = dlg.getName(); + foreach(QString key, mapping.keys()) { + if(mapping[key] == curname) { + mapping[key] = newname; + break; + } + } + QVariant id = identities.take(curname); + identities[newname] = id; + QListWidgetItem *item = ui.identList->currentItem(); + item->setText(newname); + sortList(); + ui.identList->setCurrentItem(item); + selectionChanged(); + } +} + +void IdentitiesEditDlg::deleteIdentity() { + QString curname = ui.identList->currentItem()->text(); + if(QMessageBox::question(this, tr("Delete Identity?"), + tr("Do you really want to delete identity \"%1\"?\nNetworks using this identity " + "will be reset to use the default identity.").arg(curname), + tr("&Delete"), tr("&Cancel"), QString(), 1, 1) == 0) { + delete ui.identList->takeItem(ui.identList->currentRow()); + foreach(QString key, mapping.keys()) { + if(mapping[key] == curname) { + mapping.remove(key); break; + } + } + identities.remove(curname); + selectionChanged(); + } +} + +void IdentitiesEditDlg::sortList() { + QListWidgetItem *def = ui.identList->takeItem(0); + ui.identList->sortItems(); + ui.identList->insertItem(0, def); +} + +/******************************************************************************/ + +NickEditDlg::NickEditDlg(QWidget *parent, QString nick) : QDialog(parent) { + ui.setupUi(this); + ui.lineEdit->setText(nick); + connect(ui.lineEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString))); + textChanged(nick); +} + +void NickEditDlg::textChanged(QString text) { + ui.okButton->setDisabled(text.isEmpty() || text == ""); +} + +QString NickEditDlg::getNick() { + return ui.lineEdit->text(); +} + +/*******************************************************************************/ + +RenameIdentityDlg::RenameIdentityDlg(QWidget *parent, QList _reserved, QString name) : QDialog(parent) { + ui.setupUi(this); + reserved = _reserved; + //ui.NickEditDlg->setWindowTitle(tr("Edit Identity Name")); // why does this not work? + ui.label->setText(tr("Identity:")); + ui.lineEdit->setText(name); + connect(ui.lineEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString))); + textChanged(name); +} + +void RenameIdentityDlg::textChanged(QString text) { + if(text.length() == 0) { ui.okButton->setEnabled(0); return; } + ui.okButton->setDisabled(reserved.contains(text)); +} + +QString RenameIdentityDlg::getName() { + return ui.lineEdit->text(); +} + diff --git a/gui/serverlist.h b/gui/serverlist.h new file mode 100644 index 00000000..854b2403 --- /dev/null +++ b/gui/serverlist.h @@ -0,0 +1,178 @@ +/*************************************************************************** + * Copyright (C) 2005 by The Quassel Team * + * 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) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _SERVERLIST_H_ +#define _SERVERLIST_H_ + +#include +#include +#include +#include + +#include "ui_serverlistdlg.h" +#include "ui_identitiesdlg.h" +#include "ui_identitieseditdlg.h" +#include "ui_nickeditdlg.h" +#include "ui_networkeditdlg.h" + +typedef QMap VarMap; + +class ServerListDlg : public QDialog { + Q_OBJECT + + public: + ServerListDlg(QWidget *parent); + virtual ~ServerListDlg(); + + bool showOnStartup(); + + public slots: + void editIdentities(); + + private slots: + void updateButtons(); + void on_showOnStartup_stateChanged(int); + void on_addButton_clicked(); + + private: + Ui::ServerListDlg ui; + + void loadNetworks(); + void storeNetworks(); + void loadIdentities(); + void storeIdentities(); + + VarMap networks; + VarMap identities; +}; + +class NetworkEditDlg : public QDialog { + Q_OBJECT + + public: + NetworkEditDlg(QWidget *parent, VarMap network, VarMap identities); + + private: + Ui::NetworkEditDlg ui; + + VarMap network; + VarMap identities; + + VarMap createDefaultNetwork(); +}; + +class IdentitiesDlg : public QDialog { + Q_OBJECT + + public: + IdentitiesDlg(QWidget *parent, VarMap identities); + + VarMap getIdentities() { return identities; } + QMap getNameMapping() { return nameMapping; } + + public slots: + virtual void accept(); + + private slots: + void autoAwayChecked(); + void identityChanged(QString); + void nickSelectionChanged(); + + void addNick(); + void editNick(); + void delNick(); + void upNick(); + void downNick(); + + void editIdentities(); + + private: + Ui::IdentitiesDlg ui; + VarMap identities; + QMap nameMapping; + QString lastIdentity; + + QString checkValidity(); + VarMap createDefaultIdentity(); + QString getCurIdentity(); + void updateWidgets(); + void updateIdentity(QString); +}; + +class NickEditDlg : public QDialog { + Q_OBJECT + + public: + NickEditDlg(QWidget *parent, QString nick = QString()); + + QString getNick(); + + private slots: + void textChanged(QString); + + private: + Ui::NickEditDlg ui; + +}; + +class IdentitiesEditDlg : public QDialog { + Q_OBJECT + + public: + IdentitiesEditDlg(QWidget *parent, VarMap identities, QMap mapping, VarMap templ); + + VarMap getIdentities() { return identities; } + QMap getMapping() { return mapping; } + + private slots: + void selectionChanged(); + + void addIdentity(); + void duplicateIdentity(); + void renameIdentity(); + void deleteIdentity(); + + private: + Ui::IdentitiesEditDlg ui; + + VarMap identities; + VarMap identTemplate; + QMap mapping; + + void sortList(); +}; + +class RenameIdentityDlg : public QDialog { + Q_OBJECT + + public: + RenameIdentityDlg(QWidget *parent, QList reserved, QString name = QString()); + + QString getName(); + + private slots: + void textChanged(QString); + + private: + Ui::NickEditDlg ui; + QList reserved; +}; + +#endif diff --git a/gui/serverlistdlg.ui b/gui/serverlistdlg.ui new file mode 100644 index 00000000..98793b5d --- /dev/null +++ b/gui/serverlistdlg.ui @@ -0,0 +1,248 @@ + + + + + ServerListDlg + + + + 0 + 0 + 757 + 444 + + + + Server List + + + :/default/server.png + + + false + + + false + + + + 8 + + + 6 + + + + + 0 + + + 6 + + + + + false + + + true + + + QAbstractItemView::ExtendedSelection + + + true + + + + + + + 0 + + + 6 + + + + + &Add... + + + :/default/edit_add.png + + + + + + + false + + + &Edit... + + + :/default/edit.png + + + + + + + false + + + &Delete + + + :/default/edit_remove.png + + + + + + + Qt::Vertical + + + + 85 + 296 + + + + + + + + + + + + 0 + + + 6 + + + + + &Show this dialog on startup + + + + + + + Qt::Horizontal + + + + 291 + 25 + + + + + + + + false + + + &Connect + + + :/default/connect_creating.png + + + false + + + + + + + C&lose + + + :/default/button_cancel.png + + + true + + + + + + + + + + 9 + 9 + 739 + 393 + + + + + + + 9 + 408 + 739 + 27 + + + + + + + 660 + 10 + 87 + 391 + + + + + + + + + + + connectButton + clicked() + ServerListDlg + accept() + + + 278 + 253 + + + 96 + 254 + + + + + closeButton + clicked() + ServerListDlg + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/images/default/1downarrow.png b/images/default/1downarrow.png new file mode 100644 index 00000000..2dd28e91 Binary files /dev/null and b/images/default/1downarrow.png differ diff --git a/images/default/1leftarrow.png b/images/default/1leftarrow.png new file mode 100644 index 00000000..5b07c5e5 Binary files /dev/null and b/images/default/1leftarrow.png differ diff --git a/images/default/1rightarrow.png b/images/default/1rightarrow.png new file mode 100644 index 00000000..70cfd5f2 Binary files /dev/null and b/images/default/1rightarrow.png differ diff --git a/images/default/1uparrow.png b/images/default/1uparrow.png new file mode 100644 index 00000000..c6bd1fb2 Binary files /dev/null and b/images/default/1uparrow.png differ diff --git a/images/default/2dowarrow.png b/images/default/2dowarrow.png new file mode 100644 index 00000000..da30eed2 Binary files /dev/null and b/images/default/2dowarrow.png differ diff --git a/images/default/2downarrow.png b/images/default/2downarrow.png new file mode 100644 index 00000000..f1185964 Binary files /dev/null and b/images/default/2downarrow.png differ diff --git a/images/default/2leftarrow.png b/images/default/2leftarrow.png new file mode 100644 index 00000000..a74151cc Binary files /dev/null and b/images/default/2leftarrow.png differ diff --git a/images/default/2rightarrow.png b/images/default/2rightarrow.png new file mode 100644 index 00000000..a9ed97c2 Binary files /dev/null and b/images/default/2rightarrow.png differ diff --git a/images/default/2uparrow.png b/images/default/2uparrow.png new file mode 100644 index 00000000..d20b609c Binary files /dev/null and b/images/default/2uparrow.png differ diff --git a/images/default/3downarrow.png b/images/default/3downarrow.png new file mode 100644 index 00000000..d1600832 Binary files /dev/null and b/images/default/3downarrow.png differ diff --git a/images/default/3uparrow.png b/images/default/3uparrow.png new file mode 100644 index 00000000..51665324 Binary files /dev/null and b/images/default/3uparrow.png differ diff --git a/images/default/add_user.png b/images/default/add_user.png new file mode 100644 index 00000000..cec9f51f Binary files /dev/null and b/images/default/add_user.png differ diff --git a/images/default/apply.png b/images/default/apply.png new file mode 100644 index 00000000..46710a0c Binary files /dev/null and b/images/default/apply.png differ diff --git a/images/default/back.png b/images/default/back.png new file mode 100644 index 00000000..b04d9220 Binary files /dev/null and b/images/default/back.png differ diff --git a/images/default/bell.png b/images/default/bell.png new file mode 100644 index 00000000..9a7b6ae1 Binary files /dev/null and b/images/default/bell.png differ diff --git a/images/default/bookmark.png b/images/default/bookmark.png new file mode 100644 index 00000000..50e9551a Binary files /dev/null and b/images/default/bookmark.png differ diff --git a/images/default/bookmark_add.png b/images/default/bookmark_add.png new file mode 100644 index 00000000..b2f4090c Binary files /dev/null and b/images/default/bookmark_add.png differ diff --git a/images/default/bookmark_folder.png b/images/default/bookmark_folder.png new file mode 100644 index 00000000..7da3bbe8 Binary files /dev/null and b/images/default/bookmark_folder.png differ diff --git a/images/default/bookmark_toolbar.png b/images/default/bookmark_toolbar.png new file mode 100644 index 00000000..fdf17ca5 Binary files /dev/null and b/images/default/bookmark_toolbar.png differ diff --git a/images/default/bookmarks_list_add.png b/images/default/bookmarks_list_add.png new file mode 100644 index 00000000..e1d093ae Binary files /dev/null and b/images/default/bookmarks_list_add.png differ diff --git a/images/default/bottom.png b/images/default/bottom.png new file mode 100644 index 00000000..13a0de5a Binary files /dev/null and b/images/default/bottom.png differ diff --git a/images/default/button_cancel.png b/images/default/button_cancel.png new file mode 100644 index 00000000..e9920bf4 Binary files /dev/null and b/images/default/button_cancel.png differ diff --git a/images/default/button_ok.png b/images/default/button_ok.png new file mode 100644 index 00000000..46710a0c Binary files /dev/null and b/images/default/button_ok.png differ diff --git a/images/default/cancel.png b/images/default/cancel.png new file mode 100644 index 00000000..e9920bf4 Binary files /dev/null and b/images/default/cancel.png differ diff --git a/images/default/configure.png b/images/default/configure.png new file mode 100644 index 00000000..4158b760 Binary files /dev/null and b/images/default/configure.png differ diff --git a/images/default/configure_shortcuts.png b/images/default/configure_shortcuts.png new file mode 100644 index 00000000..47d469e0 Binary files /dev/null and b/images/default/configure_shortcuts.png differ diff --git a/images/default/configure_toolbars.png b/images/default/configure_toolbars.png new file mode 100644 index 00000000..653479bf Binary files /dev/null and b/images/default/configure_toolbars.png differ diff --git a/images/default/connect_creating.png b/images/default/connect_creating.png new file mode 100644 index 00000000..eebad595 Binary files /dev/null and b/images/default/connect_creating.png differ diff --git a/images/default/connect_established.png b/images/default/connect_established.png new file mode 100644 index 00000000..608dca13 Binary files /dev/null and b/images/default/connect_established.png differ diff --git a/images/default/connect_no.png b/images/default/connect_no.png new file mode 100644 index 00000000..eebad595 Binary files /dev/null and b/images/default/connect_no.png differ diff --git a/images/default/edit.png b/images/default/edit.png new file mode 100644 index 00000000..cd77c300 Binary files /dev/null and b/images/default/edit.png differ diff --git a/images/default/edit_add.png b/images/default/edit_add.png new file mode 100644 index 00000000..269aaa63 Binary files /dev/null and b/images/default/edit_add.png differ diff --git a/images/default/edit_remove.png b/images/default/edit_remove.png new file mode 100644 index 00000000..2c8b19da Binary files /dev/null and b/images/default/edit_remove.png differ diff --git a/images/default/edit_user.png b/images/default/edit_user.png new file mode 100644 index 00000000..6327038c Binary files /dev/null and b/images/default/edit_user.png differ diff --git a/images/default/editcopy.png b/images/default/editcopy.png new file mode 100644 index 00000000..8a227f89 Binary files /dev/null and b/images/default/editcopy.png differ diff --git a/images/default/edittrash.png b/images/default/edittrash.png new file mode 100644 index 00000000..019f8a75 Binary files /dev/null and b/images/default/edittrash.png differ diff --git a/images/default/exit.png b/images/default/exit.png new file mode 100644 index 00000000..c2c19fb8 Binary files /dev/null and b/images/default/exit.png differ diff --git a/images/default/fileclose.png b/images/default/fileclose.png new file mode 100644 index 00000000..edf5f76f Binary files /dev/null and b/images/default/fileclose.png differ diff --git a/images/default/filenew.png b/images/default/filenew.png new file mode 100644 index 00000000..bfe1d06e Binary files /dev/null and b/images/default/filenew.png differ diff --git a/images/default/fileopen.png b/images/default/fileopen.png new file mode 100644 index 00000000..037c2da9 Binary files /dev/null and b/images/default/fileopen.png differ diff --git a/images/default/fileprint.png b/images/default/fileprint.png new file mode 100644 index 00000000..e5d668e7 Binary files /dev/null and b/images/default/fileprint.png differ diff --git a/images/default/filesave.png b/images/default/filesave.png new file mode 100644 index 00000000..f6e31750 Binary files /dev/null and b/images/default/filesave.png differ diff --git a/images/default/filesaveas.png b/images/default/filesaveas.png new file mode 100644 index 00000000..4ce047fd Binary files /dev/null and b/images/default/filesaveas.png differ diff --git a/images/default/finish.png b/images/default/finish.png new file mode 100644 index 00000000..9a538090 Binary files /dev/null and b/images/default/finish.png differ diff --git a/images/default/folder.png b/images/default/folder.png new file mode 100644 index 00000000..edfd01eb Binary files /dev/null and b/images/default/folder.png differ diff --git a/images/default/folder_new.png b/images/default/folder_new.png new file mode 100644 index 00000000..130e35e0 Binary files /dev/null and b/images/default/folder_new.png differ diff --git a/images/default/fonts.png b/images/default/fonts.png new file mode 100644 index 00000000..267a732e Binary files /dev/null and b/images/default/fonts.png differ diff --git a/images/default/fontsizedown.png b/images/default/fontsizedown.png new file mode 100644 index 00000000..3c9b0b00 Binary files /dev/null and b/images/default/fontsizedown.png differ diff --git a/images/default/fontsizeup.png b/images/default/fontsizeup.png new file mode 100644 index 00000000..ceaff462 Binary files /dev/null and b/images/default/fontsizeup.png differ diff --git a/images/default/forward.png b/images/default/forward.png new file mode 100644 index 00000000..7734c2b5 Binary files /dev/null and b/images/default/forward.png differ diff --git a/images/default/help.png b/images/default/help.png new file mode 100644 index 00000000..b580f51e Binary files /dev/null and b/images/default/help.png differ diff --git a/images/default/identity.png b/images/default/identity.png new file mode 100644 index 00000000..d31e63f3 Binary files /dev/null and b/images/default/identity.png differ diff --git a/images/default/next.png b/images/default/next.png new file mode 100644 index 00000000..df6f06bd Binary files /dev/null and b/images/default/next.png differ diff --git a/images/default/no.png b/images/default/no.png new file mode 100644 index 00000000..1cabc6e9 Binary files /dev/null and b/images/default/no.png differ diff --git a/images/default/ok.png b/images/default/ok.png new file mode 100644 index 00000000..543710fb Binary files /dev/null and b/images/default/ok.png differ diff --git a/images/default/remove.png b/images/default/remove.png new file mode 100644 index 00000000..e1888861 Binary files /dev/null and b/images/default/remove.png differ diff --git a/images/default/server.png b/images/default/server.png new file mode 100644 index 00000000..ef289f6f Binary files /dev/null and b/images/default/server.png differ diff --git a/images/default/start.png b/images/default/start.png new file mode 100644 index 00000000..154bd40b Binary files /dev/null and b/images/default/start.png differ diff --git a/images/default/status_unknown.png b/images/default/status_unknown.png new file mode 100644 index 00000000..fd49f31f Binary files /dev/null and b/images/default/status_unknown.png differ diff --git a/images/default/stop.png b/images/default/stop.png new file mode 100644 index 00000000..28070132 Binary files /dev/null and b/images/default/stop.png differ diff --git a/images/default/tab.png b/images/default/tab.png new file mode 100644 index 00000000..236fb62f Binary files /dev/null and b/images/default/tab.png differ diff --git a/images/default/tab_breakoff.png b/images/default/tab_breakoff.png new file mode 100644 index 00000000..289a9efc Binary files /dev/null and b/images/default/tab_breakoff.png differ diff --git a/images/default/tab_duplicate.png b/images/default/tab_duplicate.png new file mode 100644 index 00000000..68a6bab3 Binary files /dev/null and b/images/default/tab_duplicate.png differ diff --git a/images/default/tab_first.png b/images/default/tab_first.png new file mode 100644 index 00000000..89fcc75e Binary files /dev/null and b/images/default/tab_first.png differ diff --git a/images/default/tab_last.png b/images/default/tab_last.png new file mode 100644 index 00000000..f7bcbedf Binary files /dev/null and b/images/default/tab_last.png differ diff --git a/images/default/tab_left.png b/images/default/tab_left.png new file mode 100644 index 00000000..ace0782d Binary files /dev/null and b/images/default/tab_left.png differ diff --git a/images/default/tab_new.png b/images/default/tab_new.png new file mode 100644 index 00000000..a2dde078 Binary files /dev/null and b/images/default/tab_new.png differ diff --git a/images/default/tab_new_bg.png b/images/default/tab_new_bg.png new file mode 100644 index 00000000..041c0bb0 Binary files /dev/null and b/images/default/tab_new_bg.png differ diff --git a/images/default/tab_new_raised.png b/images/default/tab_new_raised.png new file mode 100644 index 00000000..6c4423e0 Binary files /dev/null and b/images/default/tab_new_raised.png differ diff --git a/images/default/tab_remove.png b/images/default/tab_remove.png new file mode 100644 index 00000000..f1a729b7 Binary files /dev/null and b/images/default/tab_remove.png differ diff --git a/images/default/tab_right.png b/images/default/tab_right.png new file mode 100644 index 00000000..2c3e8ed1 Binary files /dev/null and b/images/default/tab_right.png differ diff --git a/images/default/top.png b/images/default/top.png new file mode 100644 index 00000000..11fff092 Binary files /dev/null and b/images/default/top.png differ diff --git a/images/default/trash.png b/images/default/trash.png new file mode 100644 index 00000000..dcf0b776 Binary files /dev/null and b/images/default/trash.png differ diff --git a/images/default/tux.png b/images/default/tux.png new file mode 100644 index 00000000..7b62ccec Binary files /dev/null and b/images/default/tux.png differ diff --git a/images/default/up.png b/images/default/up.png new file mode 100644 index 00000000..6673d10e Binary files /dev/null and b/images/default/up.png differ diff --git a/images/default/view_bottom.png b/images/default/view_bottom.png new file mode 100644 index 00000000..951ff424 Binary files /dev/null and b/images/default/view_bottom.png differ diff --git a/images/default/view_choose.png b/images/default/view_choose.png new file mode 100644 index 00000000..780ee477 Binary files /dev/null and b/images/default/view_choose.png differ diff --git a/images/default/view_detailed.png b/images/default/view_detailed.png new file mode 100644 index 00000000..f0faeb6c Binary files /dev/null and b/images/default/view_detailed.png differ diff --git a/images/default/view_icon.png b/images/default/view_icon.png new file mode 100644 index 00000000..ae11e3c7 Binary files /dev/null and b/images/default/view_icon.png differ diff --git a/images/default/view_left_right.png b/images/default/view_left_right.png new file mode 100644 index 00000000..8d584ae0 Binary files /dev/null and b/images/default/view_left_right.png differ diff --git a/images/default/view_multicolumn.png b/images/default/view_multicolumn.png new file mode 100644 index 00000000..26b6a20e Binary files /dev/null and b/images/default/view_multicolumn.png differ diff --git a/images/default/view_orientation.png b/images/default/view_orientation.png new file mode 100644 index 00000000..7d6c128c Binary files /dev/null and b/images/default/view_orientation.png differ diff --git a/images/default/view_remove 2.png b/images/default/view_remove 2.png new file mode 100644 index 00000000..0ac968cd Binary files /dev/null and b/images/default/view_remove 2.png differ diff --git a/images/default/view_remove.png b/images/default/view_remove.png new file mode 100644 index 00000000..0ac968cd Binary files /dev/null and b/images/default/view_remove.png differ diff --git a/images/default/view_right.png b/images/default/view_right.png new file mode 100644 index 00000000..d7e56978 Binary files /dev/null and b/images/default/view_right.png differ diff --git a/images/default/view_sidetree.png b/images/default/view_sidetree.png new file mode 100644 index 00000000..160b13d1 Binary files /dev/null and b/images/default/view_sidetree.png differ diff --git a/images/default/view_split.png b/images/default/view_split.png new file mode 100644 index 00000000..f355e428 Binary files /dev/null and b/images/default/view_split.png differ diff --git a/images/default/view_top_bottom.png b/images/default/view_top_bottom.png new file mode 100644 index 00000000..28b4a4b1 Binary files /dev/null and b/images/default/view_top_bottom.png differ diff --git a/images/default/wizard.png b/images/default/wizard.png new file mode 100644 index 00000000..3107990d Binary files /dev/null and b/images/default/wizard.png differ diff --git a/images/iconmap.xml b/images/iconmap.xml new file mode 100644 index 00000000..091b590b --- /dev/null +++ b/images/iconmap.xml @@ -0,0 +1,8 @@ + + + images/default_icons + + 1uparrow.png + 1downarrow.png + + diff --git a/images/icons.qrc b/images/icons.qrc new file mode 100644 index 00000000..4f8d0ce2 --- /dev/null +++ b/images/icons.qrc @@ -0,0 +1,93 @@ + + + default/1downarrow.png + default/1leftarrow.png + default/1rightarrow.png + default/1uparrow.png + default/2dowarrow.png + default/2downarrow.png + default/2leftarrow.png + default/2rightarrow.png + default/2uparrow.png + default/3downarrow.png + default/3uparrow.png + default/add_user.png + default/apply.png + default/back.png + default/bell.png + default/bookmark.png + default/bookmark_add.png + default/bookmark_folder.png + default/bookmark_toolbar.png + default/bookmarks_list_add.png + default/bottom.png + default/button_cancel.png + default/button_ok.png + default/cancel.png + default/configure.png + default/configure_shortcuts.png + default/configure_toolbars.png + default/connect_creating.png + default/connect_established.png + default/connect_no.png + default/edit.png + default/edit_add.png + default/edit_remove.png + default/edit_user.png + default/editcopy.png + default/edittrash.png + default/exit.png + default/fileclose.png + default/filenew.png + default/fileopen.png + default/fileprint.png + default/filesave.png + default/filesaveas.png + default/finish.png + default/folder.png + default/folder_new.png + default/fonts.png + default/fontsizedown.png + default/fontsizeup.png + default/forward.png + default/help.png + default/identity.png + default/next.png + default/no.png + default/ok.png + default/remove.png + default/server.png + default/start.png + default/status_unknown.png + default/stop.png + default/tab.png + default/tab_breakoff.png + default/tab_duplicate.png + default/tab_first.png + default/tab_last.png + default/tab_left.png + default/tab_new.png + default/tab_new_bg.png + default/tab_new_raised.png + default/tab_remove.png + default/tab_right.png + default/top.png + default/trash.png + default/tux.png + default/up.png + default/view_bottom.png + default/view_choose.png + default/view_detailed.png + default/view_icon.png + default/view_left_right.png + default/view_multicolumn.png + default/view_orientation.png + default/view_remove 2.png + default/view_remove.png + default/view_right.png + default/view_sidetree.png + default/view_split.png + default/view_top_bottom.png + default/wizard.png + + diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt new file mode 100644 index 00000000..86bbe990 --- /dev/null +++ b/main/CMakeLists.txt @@ -0,0 +1,6 @@ +SET(main_SRCS logger.cpp quassel.cpp) +SET(main_HDRS quassel.h) +SET(main_MOCS logger.h) + +QT4_WRAP_CPP(_MOC ${main_MOCS}) +ADD_LIBRARY(main ${_MOC} ${main_SRCS} ${main_HDRS}) diff --git a/main/logger.cpp b/main/logger.cpp new file mode 100644 index 00000000..cc9482c7 --- /dev/null +++ b/main/logger.cpp @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (C) 2005 by The Quassel Team * + * 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) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "quassel.h" +#include "logger.h" + +#include + + + +Logger::~Logger() { + qInstallMsgHandler(0); +} + +void messageHandler(QtMsgType type, const char *msg) { + switch (type) { + case QtDebugMsg: + std::cerr << "[DEBUG] " << msg << "\n"; + break; + case QtWarningMsg: + std::cerr << "[WARNING] " << msg << "\n"; + break; + case QtCriticalMsg: + std::cerr << "[CRITICAL] " << msg << "\n"; + break; + case QtFatalMsg: + std::cerr << "[FATAL] " << msg << "\n"; + abort(); // deliberately core dump + } +} + +Logger::Logger() { + qInstallMsgHandler(messageHandler); +} diff --git a/main/logger.h b/main/logger.h new file mode 100644 index 00000000..ba8eba42 --- /dev/null +++ b/main/logger.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2005 by The Quassel Team * + * 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) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _LOGGER_H_ +#define _LOGGER_H_ + +#include + +class Logger : public QObject { + Q_OBJECT + + public: + Logger(); + virtual ~Logger(); + + + + private: + //void messageHandler(QtMsgType type, const char *msg); +}; + + + +#endif diff --git a/main/main.cpp b/main/main.cpp new file mode 100644 index 00000000..9d3e5789 --- /dev/null +++ b/main/main.cpp @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2005 by The Quassel Team * + * 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) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include + +#include + +#include "quassel.h" +#include "logger.h" + +#include "mainwin.h" + +int main(int argc, char **argv) { + + Quassel::init(); + Logger *logger = new Logger(); + Quassel::setLogger(logger); + + QApplication app(argc, argv); + + QApplication::setOrganizationDomain("quassel-irc.org"); + QApplication::setApplicationName("Quassel IRC"); + QApplication::setOrganizationName("The Quassel Team"); + + MainWin mainWin; + mainWin.show(); + return app.exec(); +} diff --git a/main/quassel.cpp b/main/quassel.cpp new file mode 100644 index 00000000..91492639 --- /dev/null +++ b/main/quassel.cpp @@ -0,0 +1,65 @@ +/*************************************************************************** + * Copyright (C) 2005 by The Quassel Team * + * 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) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "quassel.h" +#include "logger.h" + +#include +#include +#include + +void Quassel::init() { + //initIconMap(); +} + +void Quassel::setLogger(Logger *) { + + +}; + + +/* not done yet */ +void Quassel::initIconMap() { + QDomDocument doc("IconMap"); + QFile file("images/iconmap.xml"); + if(!file.open(QIODevice::ReadOnly)) { + qDebug() << "Error opening iconMap file!"; + return; + } else if(!doc.setContent(&file)) { + file.close(); + qDebug() << "Error parsing iconMap file!"; + } else { + file.close(); + + } +} + + +/** + * Retrieves an icon determined by its symbolic name. The mapping shall later + * be performed by a theme manager or something like that. + * @param symbol Symbol of requested icon + * @return Pointer to a newly created QIcon + */ +QIcon *Quassel::getIcon(QString /*symbol*/) { + //if(symbol == "connect" + + return 0; +} diff --git a/main/quassel.h b/main/quassel.h new file mode 100644 index 00000000..0c2a11b5 --- /dev/null +++ b/main/quassel.h @@ -0,0 +1,53 @@ +/*************************************************************************** + * Copyright (C) 2005 by The Quassel Team * + * 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) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _QUASSEL_H_ +#define _QUASSEL_H_ + +class Logger; +class QIcon; +class QString; + +#include + + +/** + * A static class containing global data. + */ +class Quassel { + + public: + static void init(); + static Logger *getLogger(); + static void setLogger(Logger *); + + static QIcon *getIcon(QString symbol); + + private: + static void initIconMap(); + + static Logger *logger; + + static QString iconPath; + static QHash iconMap; + +}; + +#endif