From f99c7f6c54aaf96eec1f58c2eaacb46edc6de8cd Mon Sep 17 00:00:00 2001 From: Darrell Anderson Date: Mon, 6 Jan 2014 02:25:18 +0100 Subject: Rename kdebugdialog -> tdedebugdialog --- CMakeLists.txt | 4 +- README | 2 +- doc/kdebugdialog/CMakeLists.txt | 12 -- doc/kdebugdialog/Makefile.am | 3 - doc/kdebugdialog/index.docbook | 134 --------------- doc/tdedebugdialog/CMakeLists.txt | 12 ++ doc/tdedebugdialog/Makefile.am | 3 + doc/tdedebugdialog/index.docbook | 134 +++++++++++++++ doc/userguide/credits-and-license.docbook | 2 +- doc/userguide/under-the-hood.docbook | 22 +-- kdebugdialog/CMakeLists.txt | 32 ---- kdebugdialog/Makefile.am | 16 -- kdebugdialog/README | 12 -- kdebugdialog/kabstractdebugdialog.cpp | 85 ---------- kdebugdialog/kabstractdebugdialog.h | 54 ------- kdebugdialog/kdebugdialog.cpp | 260 ------------------------------ kdebugdialog/kdebugdialog.h | 93 ----------- kdebugdialog/main.cpp | 125 -------------- kdebugdialog/tdelistdebugdialog.cpp | 193 ---------------------- kdebugdialog/tdelistdebugdialog.h | 65 -------- r14-xdg-update | 8 +- tdedebugdialog/CMakeLists.txt | 32 ++++ tdedebugdialog/Makefile.am | 16 ++ tdedebugdialog/README | 12 ++ tdedebugdialog/kabstractdebugdialog.cpp | 85 ++++++++++ tdedebugdialog/kabstractdebugdialog.h | 54 +++++++ tdedebugdialog/main.cpp | 125 ++++++++++++++ tdedebugdialog/tdedebugdialog.cpp | 260 ++++++++++++++++++++++++++++++ tdedebugdialog/tdedebugdialog.h | 93 +++++++++++ tdedebugdialog/tdelistdebugdialog.cpp | 193 ++++++++++++++++++++++ tdedebugdialog/tdelistdebugdialog.h | 65 ++++++++ tdeioslave/sftp/DEBUGGING | 2 +- 32 files changed, 1107 insertions(+), 1101 deletions(-) delete mode 100644 doc/kdebugdialog/CMakeLists.txt delete mode 100644 doc/kdebugdialog/Makefile.am delete mode 100644 doc/kdebugdialog/index.docbook create mode 100644 doc/tdedebugdialog/CMakeLists.txt create mode 100644 doc/tdedebugdialog/Makefile.am create mode 100644 doc/tdedebugdialog/index.docbook delete mode 100644 kdebugdialog/CMakeLists.txt delete mode 100644 kdebugdialog/Makefile.am delete mode 100644 kdebugdialog/README delete mode 100644 kdebugdialog/kabstractdebugdialog.cpp delete mode 100644 kdebugdialog/kabstractdebugdialog.h delete mode 100644 kdebugdialog/kdebugdialog.cpp delete mode 100644 kdebugdialog/kdebugdialog.h delete mode 100644 kdebugdialog/main.cpp delete mode 100644 kdebugdialog/tdelistdebugdialog.cpp delete mode 100644 kdebugdialog/tdelistdebugdialog.h create mode 100644 tdedebugdialog/CMakeLists.txt create mode 100644 tdedebugdialog/Makefile.am create mode 100644 tdedebugdialog/README create mode 100644 tdedebugdialog/kabstractdebugdialog.cpp create mode 100644 tdedebugdialog/kabstractdebugdialog.h create mode 100644 tdedebugdialog/main.cpp create mode 100644 tdedebugdialog/tdedebugdialog.cpp create mode 100644 tdedebugdialog/tdedebugdialog.h create mode 100644 tdedebugdialog/tdelistdebugdialog.cpp create mode 100644 tdedebugdialog/tdelistdebugdialog.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d7504dc58..f94cd3c03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,7 +171,7 @@ option( BUILD_STARTTDE "Build starttde" ${BUILD_ALL} ) option( BUILD_KFIND "Build kfind" ${BUILD_ALL} ) option( BUILD_DRKONQI "Build drkonqi" ${BUILD_ALL} ) option( BUILD_KDCOP "Build kdcop" ${BUILD_ALL} ) -option( BUILD_KDEBUGDIALOG "Build kdebugdialog" ${BUILD_ALL} ) +option( BUILD_TDEDEBUGDIALOG "Build tdedebugdialog" ${BUILD_ALL} ) option( BUILD_KNETATTACH "Build knetattach" ${BUILD_ALL} ) option( BUILD_KPAGER "Build kpager" ${BUILD_ALL} ) option( BUILD_KAPPFINDER "Build kappfinder" ${BUILD_ALL} ) @@ -250,7 +250,7 @@ tde_conditional_add_subdirectory( BUILD_KSPLASHML ksplashml ) tde_conditional_add_subdirectory( BUILD_KFIND kfind ) tde_conditional_add_subdirectory( BUILD_DRKONQI drkonqi ) tde_conditional_add_subdirectory( BUILD_KDCOP kdcop ) -tde_conditional_add_subdirectory( BUILD_KDEBUGDIALOG kdebugdialog ) +tde_conditional_add_subdirectory( BUILD_TDEDEBUGDIALOG tdedebugdialog ) tde_conditional_add_subdirectory( BUILD_KNETATTACH knetattach ) tde_conditional_add_subdirectory( BUILD_KPAGER kpager ) tde_conditional_add_subdirectory( BUILD_KAPPFINDER kappfinder ) diff --git a/README b/README index 01e295240..69ebefbdb 100644 --- a/README +++ b/README @@ -47,7 +47,7 @@ libraries. Here is an overview of the directories: * kdcop GUI app to browse for DCOP interfaces, can also execute them. -* kdebugdialog +* tdedebugdialog Allows you to specify which debug messages you want to see. * tdeprint diff --git a/doc/kdebugdialog/CMakeLists.txt b/doc/kdebugdialog/CMakeLists.txt deleted file mode 100644 index 3f3ce3cf2..000000000 --- a/doc/kdebugdialog/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -tde_create_handbook( DESTINATION kdebugdialog ) diff --git a/doc/kdebugdialog/Makefile.am b/doc/kdebugdialog/Makefile.am deleted file mode 100644 index e786da562..000000000 --- a/doc/kdebugdialog/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ - -KDE_LANG = en -KDE_DOCS = AUTO diff --git a/doc/kdebugdialog/index.docbook b/doc/kdebugdialog/index.docbook deleted file mode 100644 index fefe25ce9..000000000 --- a/doc/kdebugdialog/index.docbook +++ /dev/null @@ -1,134 +0,0 @@ - -KDebugDialog"> - - - - - -]> - - - -The &kdebugdialog; Handbook - - -&David.Faure; &David.Faure.mail; - - - -2001-02-13 -0.03.00 - - -This document describes &kdebugdialog;. - - - -KDE -KDebugdialog - - - - -What is KDebugDialog? - -It is a dialog box for managing diagnostic messages at runtime. - - -If you simply start kdebugdialog, you will -see a list of areas, that can be disabled or enabled. A -kdDebug(area) call in the code will show -something in the debug output only if the area is enabled. - -Note that kdWarning, kdError and kdFatal always appear, -they are NOT controlled by this setting. - - - -Area - -The areas which should only be output. Every message -that is not mentioned here will simply not be output (unless -this field remains empty, which is the default, and means that all -messages should be output). You can enter several areas -separated by commas here, and you can also use area ranges with -the syntax start-end. Thus a valid entry could be: -117,214-289,356-359,221. Do not use whitespaces. - - - - -If you start kdebugdialog -, then for every severity level you can -define separately what should be done with the diagnostic messages of -that level, and the same for each debug area. - -In full mode, first you should select the debug area you are -interested in from the drop down list at the top. - -You may independently set the output for various types of -messages: - - -Information -Warning -Error -Fatal Error - - -For each of these types, you can set the following: - - - -Output to: - -In this Combobox, you can choose where the messages -should be output. The choices are: File, Message -Box, Shell (meaning stderr) and -Syslog. Please do not direct fatal messages to syslog -unless you are the system administrator yourself. The default is -Message Box. - - - - -Filename: -This is only enabled when you have chosen -File as the output and provides the name of that file -(which is interpreted as relative to the current folder). The -default is kdebug.dbg. - - - - -Apart from this, you can also tick the checkbox Abort -on fatal errors. In this case, if a diagnostic message with -the severity level KDEBUG_FATAL is -output, the application aborts with a SIGABRT after outputting the -message. - -When you close the dialog by pressing OK, -your entries apply immediately and are saved in -kdebugrc. When you press -Cancel, your entries are discarded and the old -ones are restored. - -Credits to Kalle Dalheimer for the original version of -&kdebugdialog; - - - -&documentation.index; - - - - diff --git a/doc/tdedebugdialog/CMakeLists.txt b/doc/tdedebugdialog/CMakeLists.txt new file mode 100644 index 000000000..d83bc9162 --- /dev/null +++ b/doc/tdedebugdialog/CMakeLists.txt @@ -0,0 +1,12 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +tde_create_handbook( DESTINATION tdedebugdialog ) diff --git a/doc/tdedebugdialog/Makefile.am b/doc/tdedebugdialog/Makefile.am new file mode 100644 index 000000000..e786da562 --- /dev/null +++ b/doc/tdedebugdialog/Makefile.am @@ -0,0 +1,3 @@ + +KDE_LANG = en +KDE_DOCS = AUTO diff --git a/doc/tdedebugdialog/index.docbook b/doc/tdedebugdialog/index.docbook new file mode 100644 index 000000000..e23d599af --- /dev/null +++ b/doc/tdedebugdialog/index.docbook @@ -0,0 +1,134 @@ + +TDEDebugDialog"> + + + + + +]> + + + +The &tdedebugdialog; Handbook + + +&David.Faure; &David.Faure.mail; + + + +2001-02-13 +0.03.00 + + +This document describes &tdedebugdialog;. + + + +KDE +TDEDebugdialog + + + + +What is TDEDebugDialog? + +It is a dialog box for managing diagnostic messages at runtime. + + +If you simply start tdedebugdialog, you will +see a list of areas, that can be disabled or enabled. A +kdDebug(area) call in the code will show +something in the debug output only if the area is enabled. + +Note that kdWarning, kdError and kdFatal always appear, +they are NOT controlled by this setting. + + + +Area + +The areas which should only be output. Every message +that is not mentioned here will simply not be output (unless +this field remains empty, which is the default, and means that all +messages should be output). You can enter several areas +separated by commas here, and you can also use area ranges with +the syntax start-end. Thus a valid entry could be: +117,214-289,356-359,221. Do not use whitespaces. + + + + +If you start tdedebugdialog +, then for every severity level you can +define separately what should be done with the diagnostic messages of +that level, and the same for each debug area. + +In full mode, first you should select the debug area you are +interested in from the drop down list at the top. + +You may independently set the output for various types of +messages: + + +Information +Warning +Error +Fatal Error + + +For each of these types, you can set the following: + + + +Output to: + +In this Combobox, you can choose where the messages +should be output. The choices are: File, Message +Box, Shell (meaning stderr) and +Syslog. Please do not direct fatal messages to syslog +unless you are the system administrator yourself. The default is +Message Box. + + + + +Filename: +This is only enabled when you have chosen +File as the output and provides the name of that file +(which is interpreted as relative to the current folder). The +default is kdebug.dbg. + + + + +Apart from this, you can also tick the checkbox Abort +on fatal errors. In this case, if a diagnostic message with +the severity level KDEBUG_FATAL is +output, the application aborts with a SIGABRT after outputting the +message. + +When you close the dialog by pressing OK, +your entries apply immediately and are saved in +kdebugrc. When you press +Cancel, your entries are discarded and the old +ones are restored. + +Credits to Kalle Dalheimer for the original version of +&tdedebugdialog; + + + +&documentation.index; + + + + diff --git a/doc/userguide/credits-and-license.docbook b/doc/userguide/credits-and-license.docbook index cc1872d2e..b4395aed1 100644 --- a/doc/userguide/credits-and-license.docbook +++ b/doc/userguide/credits-and-license.docbook @@ -105,7 +105,7 @@ The &tde; Team thanks and acknowledges the original &kde; contributors of this g Wrote . -Wrote . +Wrote . diff --git a/doc/userguide/under-the-hood.docbook b/doc/userguide/under-the-hood.docbook index 62ab1a5ec..6757cc8d9 100644 --- a/doc/userguide/under-the-hood.docbook +++ b/doc/userguide/under-the-hood.docbook @@ -385,17 +385,17 @@ window. - + -&kdebugdialog; - Controlling &tde;'s Debugging Output +&tdedebugdialog; - Controlling &tde;'s Debugging Output - + Basic Usage -&kdebugdialog; is not in the &kmenu; by default. You will need to run +&tdedebugdialog; is not in the &kmenu; by default. You will need to run it from the shell or from the mini-CLI with -the command kdebugdialog. -&kdebugdialog; pops up a window with a long list of debugging areas. Each +the command tdedebugdialog. +&tdedebugdialog; pops up a window with a long list of debugging areas. Each area has a checkbox that you can check or uncheck in order to enable or disable debugging output for that part of &tde;. @@ -416,13 +416,13 @@ buttons which will cause &tde; to produce a mountain of debugging output, or very little. - -KDebugDialog in full mode + +TDEDebugDialog in full mode - + -In full mode, which is what you get when you start kdebugdialog as -kdebugdialog +In full mode, which is what you get when you start tdedebugdialog as +tdedebugdialog , the same list of debugging areas as in plain mode is available, but you can select only one at a time from a drop-down box. You may then independently set the output diff --git a/kdebugdialog/CMakeLists.txt b/kdebugdialog/CMakeLists.txt deleted file mode 100644 index f6eccd0fe..000000000 --- a/kdebugdialog/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR} - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### kdebugdialog (executable) ################# - -tde_add_executable( kdebugdialog AUTOMOC - SOURCES - main.cpp kabstractdebugdialog.cpp kdebugdialog.cpp - tdelistdebugdialog.cpp - LINK tdeui-shared - DESTINATION ${BIN_INSTALL_DIR} -) diff --git a/kdebugdialog/Makefile.am b/kdebugdialog/Makefile.am deleted file mode 100644 index 9d5a6e257..000000000 --- a/kdebugdialog/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -## Makefile.am of kdebugdialog - -INCLUDES= $(all_includes) - -####### Files - -bin_PROGRAMS = kdebugdialog - -kdebugdialog_SOURCES = main.cpp kabstractdebugdialog.cpp kdebugdialog.cpp tdelistdebugdialog.cpp -kdebugdialog_METASOURCES = AUTO -kdebugdialog_LDFLAGS = $(all_libraries) $(KDE_RPATH) -kdebugdialog_LDADD = $(LIB_TDEUI) - -messages: - $(XGETTEXT) *.cpp -o $(podir)/kdebugdialog.pot - diff --git a/kdebugdialog/README b/kdebugdialog/README deleted file mode 100644 index 59c9fcd9f..000000000 --- a/kdebugdialog/README +++ /dev/null @@ -1,12 +0,0 @@ -kdebugdialog ------------- - -In --fullmode, you can choose to dump debug output to a file. -But keep in mind that multiple programs may be writing to that -area (and therefore to that file), so they will always be appending -to it and never clearing it. So don't forget to empty it once in a -while! - -Your configuration will of course be stored in - $HOME/.trinity/share/config/kdebugrc - diff --git a/kdebugdialog/kabstractdebugdialog.cpp b/kdebugdialog/kabstractdebugdialog.cpp deleted file mode 100644 index 10c0c2a00..000000000 --- a/kdebugdialog/kabstractdebugdialog.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2000 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "kabstractdebugdialog.h" -#include -#include -#include -#include -#include -#include - -KAbstractDebugDialog::KAbstractDebugDialog( TQWidget *parent, const char *name, bool modal ) - : KDialog( parent, name, modal ) -{ - pConfig = new TDEConfig( "kdebugrc" ); -} - -KAbstractDebugDialog::~KAbstractDebugDialog() -{ - delete pConfig; -} - -void KAbstractDebugDialog::buildButtons( TQVBoxLayout * topLayout ) -{ - TQHBoxLayout *hbox = new TQHBoxLayout( KDialog::spacingHint() ); - topLayout->addLayout( hbox ); - pHelpButton = new KPushButton( KStdGuiItem::help(), this ); - hbox->addWidget( pHelpButton ); - hbox->addStretch(10); - TQSpacerItem *spacer = new TQSpacerItem(40, 0); - hbox->addItem(spacer); - pOKButton = new KPushButton( KStdGuiItem::ok(), this ); - hbox->addWidget( pOKButton ); - pApplyButton = new KPushButton( KStdGuiItem::apply(), this ); - hbox->addWidget( pApplyButton ); - pCancelButton = new KPushButton( KStdGuiItem::cancel(), this ); - hbox->addWidget( pCancelButton ); - - int w1 = pHelpButton->sizeHint().width(); - int w2 = pOKButton->sizeHint().width(); - int w3 = pCancelButton->sizeHint().width(); - int w4 = TQMAX( w1, TQMAX( w2, w3 ) ); - int w5 = pApplyButton->sizeHint().width(); - w4 = TQMAX(w4, w5); - - pHelpButton->setFixedWidth( w4 ); - pOKButton->setFixedWidth( w4 ); - pApplyButton->setFixedWidth( w4 ); - pCancelButton->setFixedWidth( w4 ); - - connect( pHelpButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotShowHelp() ) ); - connect( pOKButton, TQT_SIGNAL( clicked() ), TQT_SLOT( accept() ) ); - connect( pApplyButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotApply() ) ); - connect( pCancelButton, TQT_SIGNAL( clicked() ), TQT_SLOT( reject() ) ); -} - -void KAbstractDebugDialog::slotShowHelp() -{ - if (kapp) - kapp->invokeHelp(); -} - -void KAbstractDebugDialog::slotApply() -{ - save(); - pConfig->sync(); -} - -#include "kabstractdebugdialog.moc" diff --git a/kdebugdialog/kabstractdebugdialog.h b/kdebugdialog/kabstractdebugdialog.h deleted file mode 100644 index 6e3655973..000000000 --- a/kdebugdialog/kabstractdebugdialog.h +++ /dev/null @@ -1,54 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2000 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KABSTRACTDEBUGDIALOG__H -#define KABSTRACTDEBUGDIALOG__H - -#include - -class TDEConfig; -class TQVBoxLayout; -class KPushButton; - -class KAbstractDebugDialog : public KDialog -{ - Q_OBJECT -public: - KAbstractDebugDialog( TQWidget *parent=0, const char *name=0, bool modal=true ); - - virtual ~KAbstractDebugDialog(); - - virtual void buildButtons(TQVBoxLayout * topLayout); - - virtual void save() = 0; - TDEConfig * config() { return pConfig; } - -protected slots: - void slotShowHelp(); - void slotApply(); - -protected: - TDEConfig* pConfig; - KPushButton* pOKButton; - KPushButton* pCancelButton; - KPushButton* pHelpButton; - KPushButton* pApplyButton; -}; - -#endif diff --git a/kdebugdialog/kdebugdialog.cpp b/kdebugdialog/kdebugdialog.cpp deleted file mode 100644 index fc80bd486..000000000 --- a/kdebugdialog/kdebugdialog.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) - Copyright (C) 1999 David Faure (faure@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "kdebugdialog.h" - -KDebugDialog::KDebugDialog( TQStringList areaList, TQWidget *parent, const char *name, bool modal ) - : KAbstractDebugDialog( parent, name, modal ) -{ - setCaption(i18n("Debug Settings")); - - TQVBoxLayout *topLayout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); - if( topLayout == 0 ) { return; } // can this happen ? - - TQLabel * tmpLabel = new TQLabel( i18n("Debug area:"), this ); - tmpLabel->setFixedHeight( fontMetrics().lineSpacing() ); - topLayout->addWidget( tmpLabel ); - - // Build combo of debug areas - pDebugAreas = new TQComboBox( false, this ); - pDebugAreas->setFixedHeight( pDebugAreas->sizeHint().height() ); - pDebugAreas->insertStringList( areaList ); - topLayout->addWidget( pDebugAreas ); - - TQGridLayout *gbox = new TQGridLayout( 2, 2, KDialog::marginHint() ); - if( gbox == 0 ) { return; } - topLayout->addLayout( TQT_TQLAYOUT(gbox) ); - - TQStringList destList; - destList.append( i18n("File") ); - destList.append( i18n("Message Box") ); - destList.append( i18n("Shell") ); - destList.append( i18n("Syslog") ); - destList.append( i18n("None") ); - - // - // Upper left frame - // - pInfoGroup = new TQGroupBox( i18n("Information"), this ); - gbox->addWidget( pInfoGroup, 0, 0 ); - TQVBoxLayout *vbox = new TQVBoxLayout( pInfoGroup, KDialog::spacingHint() ); - vbox->addSpacing( fontMetrics().lineSpacing() ); - pInfoLabel1 = new TQLabel( i18n("Output to:"), pInfoGroup ); - vbox->addWidget( pInfoLabel1 ); - pInfoCombo = new TQComboBox( false, pInfoGroup ); - connect(pInfoCombo, TQT_SIGNAL(activated(int)), - this, TQT_SLOT(slotDestinationChanged(int))); - vbox->addWidget( pInfoCombo ); - pInfoCombo->insertStringList( destList ); - pInfoLabel2 = new TQLabel( i18n("Filename:"), pInfoGroup ); - vbox->addWidget( pInfoLabel2 ); - pInfoFile = new TQLineEdit( pInfoGroup ); - vbox->addWidget( pInfoFile ); - /* - pInfoLabel3 = new TQLabel( i18n("Show only area(s):"), pInfoGroup ); - vbox->addWidget( pInfoLabel3 ); - pInfoShow = new TQLineEdit( pInfoGroup ); - vbox->addWidget( pInfoShow ); - */ - - // - // Upper right frame - // - pWarnGroup = new TQGroupBox( i18n("Warning"), this ); - gbox->addWidget( pWarnGroup, 0, 1 ); - vbox = new TQVBoxLayout( pWarnGroup, KDialog::spacingHint() ); - vbox->addSpacing( fontMetrics().lineSpacing() ); - pWarnLabel1 = new TQLabel( i18n("Output to:"), pWarnGroup ); - vbox->addWidget( pWarnLabel1 ); - pWarnCombo = new TQComboBox( false, pWarnGroup ); - connect(pWarnCombo, TQT_SIGNAL(activated(int)), - this, TQT_SLOT(slotDestinationChanged(int))); - vbox->addWidget( pWarnCombo ); - pWarnCombo->insertStringList( destList ); - pWarnLabel2 = new TQLabel( i18n("Filename:"), pWarnGroup ); - vbox->addWidget( pWarnLabel2 ); - pWarnFile = new TQLineEdit( pWarnGroup ); - vbox->addWidget( pWarnFile ); - /* - pWarnLabel3 = new TQLabel( i18n("Show only area(s):"), pWarnGroup ); - vbox->addWidget( pWarnLabel3 ); - pWarnShow = new TQLineEdit( pWarnGroup ); - vbox->addWidget( pWarnShow ); - */ - - // - // Lower left frame - // - pErrorGroup = new TQGroupBox( i18n("Error"), this ); - gbox->addWidget( pErrorGroup, 1, 0 ); - vbox = new TQVBoxLayout( pErrorGroup, KDialog::spacingHint() ); - vbox->addSpacing( fontMetrics().lineSpacing() ); - pErrorLabel1 = new TQLabel( i18n("Output to:"), pErrorGroup ); - vbox->addWidget( pErrorLabel1 ); - pErrorCombo = new TQComboBox( false, pErrorGroup ); - connect(pErrorCombo, TQT_SIGNAL(activated(int)), - this, TQT_SLOT(slotDestinationChanged(int))); - vbox->addWidget( pErrorCombo ); - pErrorCombo->insertStringList( destList ); - pErrorLabel2 = new TQLabel( i18n("Filename:"), pErrorGroup ); - vbox->addWidget( pErrorLabel2 ); - pErrorFile = new TQLineEdit( pErrorGroup ); - vbox->addWidget( pErrorFile ); - /* - pErrorLabel3 = new TQLabel( i18n("Show only area(s):"), pErrorGroup ); - vbox->addWidget( pErrorLabel3 ); - pErrorShow = new TQLineEdit( pErrorGroup ); - vbox->addWidget( pErrorShow ); - */ - - // - // Lower right frame - // - pFatalGroup = new TQGroupBox( i18n("Fatal Error"), this ); - gbox->addWidget( pFatalGroup, 1, 1 ); - vbox = new TQVBoxLayout( pFatalGroup, KDialog::spacingHint() ); - vbox->addSpacing( fontMetrics().lineSpacing() ); - pFatalLabel1 = new TQLabel( i18n("Output to:"), pFatalGroup ); - vbox->addWidget( pFatalLabel1 ); - pFatalCombo = new TQComboBox( false, pFatalGroup ); - connect(pFatalCombo, TQT_SIGNAL(activated(int)), - this, TQT_SLOT(slotDestinationChanged(int))); - vbox->addWidget( pFatalCombo ); - pFatalCombo->insertStringList( destList ); - pFatalLabel2 = new TQLabel( i18n("Filename:"), pFatalGroup ); - vbox->addWidget( pFatalLabel2 ); - pFatalFile = new TQLineEdit( pFatalGroup ); - vbox->addWidget( pFatalFile ); - /* - pFatalLabel3 = new TQLabel( i18n("Show only area(s):"), pFatalGroup ); - vbox->addWidget( pFatalLabel3 ); - pFatalShow = new TQLineEdit( pFatalGroup ); - vbox->addWidget( pFatalShow ); - */ - - - pAbortFatal = new TQCheckBox( i18n("Abort on fatal errors"), this ); - topLayout->addWidget(pAbortFatal); - - topLayout->addStretch(); - KSeparator *hline = new KSeparator( KSeparator::HLine, this ); - topLayout->addWidget( hline ); - - buildButtons( topLayout ); - - connect( pDebugAreas, TQT_SIGNAL( activated( const TQString &) ), - TQT_SLOT( slotDebugAreaChanged( const TQString & ) ) ); - - // Get initial values ("initial" is understood by the slot) - slotDebugAreaChanged( "0 initial" ); - slotDestinationChanged(0); - - resize( 300, height() ); -} - -KDebugDialog::~KDebugDialog() -{ -} - -void KDebugDialog::slotDebugAreaChanged( const TQString & text ) -{ - // Save settings from previous page - if ( text != "0 initial" ) // except on first call - save(); - - TQString data = text.simplifyWhiteSpace(); - int space = data.find(" "); - if (space == -1) - kdError() << "No space:" << data << endl; - - bool longOK; - unsigned long number = data.left(space).toULong(&longOK); - if (!longOK) - kdError() << "The first part wasn't a number : " << data << endl; - - /* Fill dialog fields with values from config data */ - pConfig->setGroup( TQString::number( number ) ); // Group name = debug area code - pInfoCombo->setCurrentItem( pConfig->readNumEntry( "InfoOutput", 2 ) ); - pInfoFile->setText( pConfig->readPathEntry( "InfoFilename","kdebug.dbg" ) ); - //pInfoShow->setText( pConfig->readEntry( "InfoShow" ) ); - pWarnCombo->setCurrentItem( pConfig->readNumEntry( "WarnOutput", 2 ) ); - pWarnFile->setText( pConfig->readPathEntry( "WarnFilename","kdebug.dbg" ) ); - //pWarnShow->setText( pConfig->readEntry( "WarnShow" ) ); - pErrorCombo->setCurrentItem( pConfig->readNumEntry( "ErrorOutput", 2 ) ); - pErrorFile->setText( pConfig->readPathEntry( "ErrorFilename","kdebug.dbg") ); - //pErrorShow->setText( pConfig->readEntry( "ErrorShow" ) ); - pFatalCombo->setCurrentItem( pConfig->readNumEntry( "FatalOutput", 2 ) ); - pFatalFile->setText( pConfig->readPathEntry("FatalFilename","kdebug.dbg") ); - //pFatalShow->setText( pConfig->readEntry( "FatalShow" ) ); - pAbortFatal->setChecked( pConfig->readNumEntry( "AbortFatal", 1 ) ); - slotDestinationChanged(0); -} - -void KDebugDialog::save() -{ - pConfig->writeEntry( "InfoOutput", pInfoCombo->currentItem() ); - pConfig->writePathEntry( "InfoFilename", pInfoFile->text() ); - //pConfig->writeEntry( "InfoShow", pInfoShow->text() ); - pConfig->writeEntry( "WarnOutput", pWarnCombo->currentItem() ); - pConfig->writePathEntry( "WarnFilename", pWarnFile->text() ); - //pConfig->writeEntry( "WarnShow", pWarnShow->text() ); - pConfig->writeEntry( "ErrorOutput", pErrorCombo->currentItem() ); - pConfig->writePathEntry( "ErrorFilename", pErrorFile->text() ); - //pConfig->writeEntry( "ErrorShow", pErrorShow->text() ); - pConfig->writeEntry( "FatalOutput", pFatalCombo->currentItem() ); - pConfig->writePathEntry( "FatalFilename", pFatalFile->text() ); - //pConfig->writeEntry( "FatalShow", pFatalShow->text() ); - pConfig->writeEntry( "AbortFatal", pAbortFatal->isChecked() ); - - TQByteArray data; - if (!kapp->dcopClient()->send("*", "KDebug", "notifyKDebugConfigChanged()", data)) - { - kdError() << "Unable to send DCOP message" << endl; - } -} - -void KDebugDialog::slotDestinationChanged(int) { - pInfoFile->setEnabled(pInfoCombo->currentItem() == 0); - pWarnFile->setEnabled(pWarnCombo->currentItem() == 0); - pErrorFile->setEnabled(pErrorCombo->currentItem() == 0); - pFatalFile->setEnabled(pFatalCombo->currentItem() == 0); -} - -#include "kdebugdialog.moc" diff --git a/kdebugdialog/kdebugdialog.h b/kdebugdialog/kdebugdialog.h deleted file mode 100644 index eabe46429..000000000 --- a/kdebugdialog/kdebugdialog.h +++ /dev/null @@ -1,93 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#ifndef _KDEBUGDIALOG -#define _KDEBUGDIALOG - -#include "kabstractdebugdialog.h" - -class TQLineEdit; -class TQComboBox; -class TQLabel; -class TQGroupBox; -class TQCheckBox; -class TQPushButton; - -class TDEConfig; - -/** - * Control debug/warning/error/fatal output of TDE applications - * - * This dialog allows control of debugging output for all TDE apps. - * - * @author Kalle Dalheimer (kalle@kde.org) - */ -class KDebugDialog : public KAbstractDebugDialog -{ - Q_OBJECT - -public: - KDebugDialog( TQStringList areaList, TQWidget *parent=0, const char *name=0, bool modal=true ); - virtual ~KDebugDialog(); - - void save(); - -protected slots: - void slotDebugAreaChanged( const TQString & ); - void slotDestinationChanged(int); - -private: - TQComboBox* pDebugAreas; - TQGroupBox* pInfoGroup; - TQLabel* pInfoLabel1; - TQComboBox* pInfoCombo; - TQLabel* pInfoLabel2; - TQLineEdit* pInfoFile; - TQLabel* pInfoLabel3; - TQLineEdit* pInfoShow; - TQGroupBox* pWarnGroup; - TQLabel* pWarnLabel1; - TQComboBox* pWarnCombo; - TQLabel* pWarnLabel2; - TQLineEdit* pWarnFile; - TQLabel* pWarnLabel3; - TQLineEdit* pWarnShow; - TQGroupBox* pErrorGroup; - TQLabel* pErrorLabel1; - TQComboBox* pErrorCombo; - TQLabel* pErrorLabel2; - TQLineEdit* pErrorFile; - TQLabel* pErrorLabel3; - TQLineEdit* pErrorShow; - TQGroupBox* pFatalGroup; - TQLabel* pFatalLabel1; - TQComboBox* pFatalCombo; - TQLabel* pFatalLabel2; - TQLineEdit* pFatalFile; - TQLabel* pFatalLabel3; - TQLineEdit* pFatalShow; - - TQCheckBox* pAbortFatal; - -private: - // Disallow assignment and copy-construction - KDebugDialog( const KDebugDialog& ); - KDebugDialog& operator= ( const KDebugDialog& ); -}; - -#endif diff --git a/kdebugdialog/main.cpp b/kdebugdialog/main.cpp deleted file mode 100644 index b70d7d0e1..000000000 --- a/kdebugdialog/main.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2000 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "kdebugdialog.h" -#include "tdelistdebugdialog.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -TQStringList readAreaList() -{ - TQStringList lst; - lst.append( "0 (generic)" ); - - TQString confAreasFile = locate( "config", "kdebug.areas" ); - TQFile file( confAreasFile ); - if (!file.open(IO_ReadOnly)) { - kdWarning() << "Couldn't open " << confAreasFile << endl; - file.close(); - } - else - { - TQString data; - - TQTextStream *ts = new TQTextStream(&file); - ts->setEncoding( TQTextStream::Latin1 ); - while (!ts->eof()) { - data = ts->readLine().simplifyWhiteSpace(); - - int pos = data.find("#"); - if ( pos != -1 ) - data.truncate( pos ); - - if (data.isEmpty()) - continue; - - lst.append( data ); - } - - delete ts; - file.close(); - } - - return lst; -} - -static TDECmdLineOptions options[] = -{ - { "fullmode", I18N_NOOP("Show the fully-fledged dialog instead of the default list dialog"), 0 }, - { "on ", /*I18N_NOOP TODO*/ "Turn area on", 0 }, - { "off ", /*I18N_NOOP TODO*/ "Turn area off", 0 }, - TDECmdLineLastOption -}; - -int main(int argc, char ** argv) -{ - TDEAboutData data( "kdebugdialog", I18N_NOOP( "KDebugDialog"), - "1.0", I18N_NOOP("A dialog box for setting preferences for debug output"), - TDEAboutData::License_GPL, "(c) 2009,2010, Timothy Pearson "); - data.addAuthor("Timothy Pearson", I18N_NOOP("Maintainer"), "kb9vqf@pearsoncomputing.net"); - data.addAuthor("David Faure", I18N_NOOP("Original maintainer/developer"), "faure@kde.org"); - TDECmdLineArgs::init( argc, argv, &data ); - TDECmdLineArgs::addCmdLineOptions( options ); - KUniqueApplication::addCmdLineOptions(); - KUniqueApplication app; - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - - TQStringList areaList ( readAreaList() ); - KAbstractDebugDialog * dialog; - if (args->isSet("fullmode")) - dialog = new KDebugDialog(areaList, 0L); - else - { - TDEListDebugDialog * listdialog = new TDEListDebugDialog(areaList, 0L); - if (args->isSet("on")) - { - listdialog->activateArea( args->getOption("on"), true ); - /*listdialog->save(); - listdialog->config()->sync(); - return 0;*/ - } else if ( args->isSet("off") ) - { - listdialog->activateArea( args->getOption("off"), false ); - /*listdialog->save(); - listdialog->config()->sync(); - return 0;*/ - } - dialog = listdialog; - } - - /* Show dialog */ - int nRet = dialog->exec(); - if( nRet == TQDialog::Accepted ) - { - dialog->save(); - dialog->config()->sync(); - } - else - dialog->config()->rollback( true ); - - return 0; -} diff --git a/kdebugdialog/tdelistdebugdialog.cpp b/kdebugdialog/tdelistdebugdialog.cpp deleted file mode 100644 index d447b3747..000000000 --- a/kdebugdialog/tdelistdebugdialog.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2000 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - - -#include "tdelistdebugdialog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -TDEListDebugDialog::TDEListDebugDialog( TQStringList areaList, TQWidget *parent, const char *name, bool modal ) - : KAbstractDebugDialog( parent, name, modal ), - m_areaList( areaList ) -{ - setCaption(i18n("Debug Settings")); - - TQVBoxLayout *lay = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); - - m_incrSearch = new KLineEdit( this ); - lay->addWidget( m_incrSearch ); - connect( m_incrSearch, TQT_SIGNAL( textChanged( const TQString& ) ), - TQT_SLOT( generateCheckBoxes( const TQString& ) ) ); - - TQScrollView * scrollView = new TQScrollView( this ); - scrollView->setResizePolicy( TQScrollView::AutoOneFit ); - lay->addWidget( scrollView ); - - m_box = new TQVBox( scrollView->viewport() ); - scrollView->addChild( m_box ); - - generateCheckBoxes( TQString::null ); - - TQHBoxLayout* selectButs = new TQHBoxLayout( lay ); - TQPushButton* all = new TQPushButton( i18n("&Select All"), this ); - TQPushButton* none = new TQPushButton( i18n("&Deselect All"), this ); - selectButs->addWidget( all ); - selectButs->addWidget( none ); - - connect( all, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selectAll() ) ); - connect( none, TQT_SIGNAL( clicked() ), this, TQT_SLOT( deSelectAll() ) ); - - buildButtons( lay ); - resize( 350, 400 ); -} - -void TDEListDebugDialog::generateCheckBoxes( const TQString& filter ) -{ - TQPtrListIterator cb_it ( boxes ); - for( ; cb_it.current() ; ++cb_it ) - { - if( (*cb_it)->state() != TQButton::NoChange ) - m_changes.insert( (*cb_it)->name(), (*cb_it)->isChecked() ? 2 : 4 ); - } - - boxes.setAutoDelete( true ); - boxes.clear(); - boxes.setAutoDelete( false ); - - TQWidget* taborder = m_incrSearch; - TQStringList::Iterator it = m_areaList.begin(); - for ( ; it != m_areaList.end() ; ++it ) - { - TQString data = (*it).simplifyWhiteSpace(); - if ( filter.isEmpty() || data.lower().contains( filter.lower() ) ) - { - int space = data.find(" "); - if (space == -1) - kdError() << "No space:" << data << endl; - - TQString areaNumber = data.left(space); - //kdDebug() << areaNumber << endl; - TQCheckBox * cb = new TQCheckBox( data, m_box, areaNumber.latin1() ); - cb->show(); - boxes.append( cb ); - setTabOrder( taborder, cb ); - taborder = cb; - } - } - - load(); -} - -void TDEListDebugDialog::selectAll() -{ - TQPtrListIterator it ( boxes ); - for ( ; it.current() ; ++it ) { - (*it)->setChecked( true ); - m_changes.insert( (*it)->name(), 2 ); - } -} - -void TDEListDebugDialog::deSelectAll() -{ - TQPtrListIterator it ( boxes ); - for ( ; it.current() ; ++it ) { - (*it)->setChecked( false ); - m_changes.insert( (*it)->name(), 4 ); - } -} - -void TDEListDebugDialog::load() -{ - TQPtrListIterator it ( boxes ); - for ( ; it.current() ; ++it ) - { - pConfig->setGroup( (*it)->name() ); // Group name = debug area code = cb's name - - int setting = pConfig->readNumEntry( "InfoOutput", 2 ); - // override setting if in m_changes - if( m_changes.find( (*it)->name() ) != m_changes.end() ) { - setting = m_changes[ (*it)->name() ]; - } - - switch (setting) { - case 4: // off - (*it)->setChecked(false); - break; - case 2: //shell - (*it)->setChecked(true); - break; - case 3: //syslog - case 1: //msgbox - case 0: //file - default: - (*it)->setNoChange(); - /////// Uses the triState capability of checkboxes - ////// Note: it seems some styles don't draw that correctly (BUG) - break; - } - } -} - -void TDEListDebugDialog::save() -{ - TQPtrListIterator it ( boxes ); - for ( ; it.current() ; ++it ) - { - pConfig->setGroup( (*it)->name() ); // Group name = debug area code = cb's name - if ( (*it)->state() != TQButton::NoChange ) - { - int setting = (*it)->isChecked() ? 2 : 4; - pConfig->writeEntry( "InfoOutput", setting ); - } - } - //sync done by main.cpp - - // send DCOP message to all clients - TQByteArray data; - if (!kapp->dcopClient()->send("*", "KDebug", "notifyKDebugConfigChanged()", data)) - { - kdError() << "Unable to send DCOP message" << endl; - } - - m_changes.clear(); -} - -void TDEListDebugDialog::activateArea( TQCString area, bool activate ) -{ - TQPtrListIterator it ( boxes ); - for ( ; it.current() ; ++it ) - { - if ( area == (*it)->name() // debug area code = cb's name - || (*it)->text().find( TQString::fromLatin1(area) ) != -1 ) // area name included in cb text - { - (*it)->setChecked( activate ); - return; - } - } -} - -#include "tdelistdebugdialog.moc" diff --git a/kdebugdialog/tdelistdebugdialog.h b/kdebugdialog/tdelistdebugdialog.h deleted file mode 100644 index d0da5c10b..000000000 --- a/kdebugdialog/tdelistdebugdialog.h +++ /dev/null @@ -1,65 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2000 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef TDELISTDEBUGDIALOG__H -#define TDELISTDEBUGDIALOG__H - -#include "kabstractdebugdialog.h" -#include -#include -#include - -class TQVBox; -class KLineEdit; - -/** - * Control debug output of TDE applications - * This dialog offers a reduced functionality compared to the full KDebugDialog - * class, but allows to set debug output on or off to several areas much more easily. - * - * @author David Faure - */ -class TDEListDebugDialog : public KAbstractDebugDialog -{ - Q_OBJECT - -public: - TDEListDebugDialog( TQStringList areaList, TQWidget *parent=0, const char *name=0, bool modal=true ); - virtual ~TDEListDebugDialog() {} - - void activateArea( TQCString area, bool activate ); - - virtual void save(); - -protected slots: - void selectAll(); - void deSelectAll(); - - void generateCheckBoxes( const TQString& filter ); - -private: - void load(); - TQPtrList boxes; - TQStringList m_areaList; - TQVBox *m_box; - KLineEdit *m_incrSearch; - TQMap m_changes; -}; - -#endif diff --git a/r14-xdg-update b/r14-xdg-update index 87d6044cb..92de967bc 100644 --- a/r14-xdg-update +++ b/r14-xdg-update @@ -68,7 +68,7 @@ Log () { # Main script: SCRIPT_NAME="`basename \`readlink -f $0\``" -SCRIPT_VERSION=201401010 +SCRIPT_VERSION=201401050 # Allow forced execution of this script regardless of the kdeglobals setting # and allow passing a user home directory as a positional parameter. @@ -652,6 +652,12 @@ if [ "$R14_VERSION" -lt "201309150" ]; then cp -a $PROFILE_DIR/share/config/kpowersaverc $PROFILE_DIR/share/config/tdepowersaverc 2>/dev/null fi fi +if [ "$R14_VERSION" -lt "201401050" ]; then + if [ ! -f $PROFILE_DIR/share/config/tdedebugdialogrc ] && [ -f $PROFILE_DIR/share/config/kdebugdialogrc ]; then + Log " kdebugdialog->tdedebugdialog" + cp -a $PROFILE_DIR/share/config/kdebugdialogrc $PROFILE_DIR/share/config/tdedebugdialogrc 2>/dev/null + fi +fi # Disable some features new to R14, otherwise users will see an unfamiliar desktop. if [ "$R14_VERSION" -lt "201309150" ]; then diff --git a/tdedebugdialog/CMakeLists.txt b/tdedebugdialog/CMakeLists.txt new file mode 100644 index 000000000..001d5e72c --- /dev/null +++ b/tdedebugdialog/CMakeLists.txt @@ -0,0 +1,32 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### tdedebugdialog (executable) ################# + +tde_add_executable( tdedebugdialog AUTOMOC + SOURCES + main.cpp kabstractdebugdialog.cpp tdedebugdialog.cpp + tdelistdebugdialog.cpp + LINK tdeui-shared + DESTINATION ${BIN_INSTALL_DIR} +) diff --git a/tdedebugdialog/Makefile.am b/tdedebugdialog/Makefile.am new file mode 100644 index 000000000..d6249afae --- /dev/null +++ b/tdedebugdialog/Makefile.am @@ -0,0 +1,16 @@ +## Makefile.am of tdedebugdialog + +INCLUDES= $(all_includes) + +####### Files + +bin_PROGRAMS = tdedebugdialog + +tdedebugdialog_SOURCES = main.cpp kabstractdebugdialog.cpp tdedebugdialog.cpp tdelistdebugdialog.cpp +tdedebugdialog_METASOURCES = AUTO +tdedebugdialog_LDFLAGS = $(all_libraries) $(KDE_RPATH) +tdedebugdialog_LDADD = $(LIB_TDEUI) + +messages: + $(XGETTEXT) *.cpp -o $(podir)/tdedebugdialog.pot + diff --git a/tdedebugdialog/README b/tdedebugdialog/README new file mode 100644 index 000000000..2ee51ae79 --- /dev/null +++ b/tdedebugdialog/README @@ -0,0 +1,12 @@ +tdedebugdialog +------------ + +In --fullmode, you can choose to dump debug output to a file. +But keep in mind that multiple programs may be writing to that +area (and therefore to that file), so they will always be appending +to it and never clearing it. So don't forget to empty it once in a +while! + +Your configuration will of course be stored in + $HOME/.trinity/share/config/kdebugrc + diff --git a/tdedebugdialog/kabstractdebugdialog.cpp b/tdedebugdialog/kabstractdebugdialog.cpp new file mode 100644 index 000000000..10c0c2a00 --- /dev/null +++ b/tdedebugdialog/kabstractdebugdialog.cpp @@ -0,0 +1,85 @@ +/* This file is part of the KDE libraries + Copyright (C) 2000 David Faure + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "kabstractdebugdialog.h" +#include +#include +#include +#include +#include +#include + +KAbstractDebugDialog::KAbstractDebugDialog( TQWidget *parent, const char *name, bool modal ) + : KDialog( parent, name, modal ) +{ + pConfig = new TDEConfig( "kdebugrc" ); +} + +KAbstractDebugDialog::~KAbstractDebugDialog() +{ + delete pConfig; +} + +void KAbstractDebugDialog::buildButtons( TQVBoxLayout * topLayout ) +{ + TQHBoxLayout *hbox = new TQHBoxLayout( KDialog::spacingHint() ); + topLayout->addLayout( hbox ); + pHelpButton = new KPushButton( KStdGuiItem::help(), this ); + hbox->addWidget( pHelpButton ); + hbox->addStretch(10); + TQSpacerItem *spacer = new TQSpacerItem(40, 0); + hbox->addItem(spacer); + pOKButton = new KPushButton( KStdGuiItem::ok(), this ); + hbox->addWidget( pOKButton ); + pApplyButton = new KPushButton( KStdGuiItem::apply(), this ); + hbox->addWidget( pApplyButton ); + pCancelButton = new KPushButton( KStdGuiItem::cancel(), this ); + hbox->addWidget( pCancelButton ); + + int w1 = pHelpButton->sizeHint().width(); + int w2 = pOKButton->sizeHint().width(); + int w3 = pCancelButton->sizeHint().width(); + int w4 = TQMAX( w1, TQMAX( w2, w3 ) ); + int w5 = pApplyButton->sizeHint().width(); + w4 = TQMAX(w4, w5); + + pHelpButton->setFixedWidth( w4 ); + pOKButton->setFixedWidth( w4 ); + pApplyButton->setFixedWidth( w4 ); + pCancelButton->setFixedWidth( w4 ); + + connect( pHelpButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotShowHelp() ) ); + connect( pOKButton, TQT_SIGNAL( clicked() ), TQT_SLOT( accept() ) ); + connect( pApplyButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotApply() ) ); + connect( pCancelButton, TQT_SIGNAL( clicked() ), TQT_SLOT( reject() ) ); +} + +void KAbstractDebugDialog::slotShowHelp() +{ + if (kapp) + kapp->invokeHelp(); +} + +void KAbstractDebugDialog::slotApply() +{ + save(); + pConfig->sync(); +} + +#include "kabstractdebugdialog.moc" diff --git a/tdedebugdialog/kabstractdebugdialog.h b/tdedebugdialog/kabstractdebugdialog.h new file mode 100644 index 000000000..6e3655973 --- /dev/null +++ b/tdedebugdialog/kabstractdebugdialog.h @@ -0,0 +1,54 @@ +/* This file is part of the KDE libraries + Copyright (C) 2000 David Faure + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABSTRACTDEBUGDIALOG__H +#define KABSTRACTDEBUGDIALOG__H + +#include + +class TDEConfig; +class TQVBoxLayout; +class KPushButton; + +class KAbstractDebugDialog : public KDialog +{ + Q_OBJECT +public: + KAbstractDebugDialog( TQWidget *parent=0, const char *name=0, bool modal=true ); + + virtual ~KAbstractDebugDialog(); + + virtual void buildButtons(TQVBoxLayout * topLayout); + + virtual void save() = 0; + TDEConfig * config() { return pConfig; } + +protected slots: + void slotShowHelp(); + void slotApply(); + +protected: + TDEConfig* pConfig; + KPushButton* pOKButton; + KPushButton* pCancelButton; + KPushButton* pHelpButton; + KPushButton* pApplyButton; +}; + +#endif diff --git a/tdedebugdialog/main.cpp b/tdedebugdialog/main.cpp new file mode 100644 index 000000000..f1c463dce --- /dev/null +++ b/tdedebugdialog/main.cpp @@ -0,0 +1,125 @@ +/* This file is part of the KDE libraries + Copyright (C) 2000 David Faure + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "tdedebugdialog.h" +#include "tdelistdebugdialog.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +TQStringList readAreaList() +{ + TQStringList lst; + lst.append( "0 (generic)" ); + + TQString confAreasFile = locate( "config", "kdebug.areas" ); + TQFile file( confAreasFile ); + if (!file.open(IO_ReadOnly)) { + kdWarning() << "Couldn't open " << confAreasFile << endl; + file.close(); + } + else + { + TQString data; + + TQTextStream *ts = new TQTextStream(&file); + ts->setEncoding( TQTextStream::Latin1 ); + while (!ts->eof()) { + data = ts->readLine().simplifyWhiteSpace(); + + int pos = data.find("#"); + if ( pos != -1 ) + data.truncate( pos ); + + if (data.isEmpty()) + continue; + + lst.append( data ); + } + + delete ts; + file.close(); + } + + return lst; +} + +static TDECmdLineOptions options[] = +{ + { "fullmode", I18N_NOOP("Show the fully-fledged dialog instead of the default list dialog"), 0 }, + { "on ", /*I18N_NOOP TODO*/ "Turn area on", 0 }, + { "off ", /*I18N_NOOP TODO*/ "Turn area off", 0 }, + TDECmdLineLastOption +}; + +int main(int argc, char ** argv) +{ + TDEAboutData data( "tdedebugdialog", I18N_NOOP( "TDEDebugDialog"), + "1.0", I18N_NOOP("A dialog box for setting preferences for debug output"), + TDEAboutData::License_GPL, "(c) 2009,2010, Timothy Pearson "); + data.addAuthor("Timothy Pearson", I18N_NOOP("Maintainer"), "kb9vqf@pearsoncomputing.net"); + data.addAuthor("David Faure", I18N_NOOP("Original maintainer/developer"), "faure@kde.org"); + TDECmdLineArgs::init( argc, argv, &data ); + TDECmdLineArgs::addCmdLineOptions( options ); + KUniqueApplication::addCmdLineOptions(); + KUniqueApplication app; + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + + TQStringList areaList ( readAreaList() ); + KAbstractDebugDialog * dialog; + if (args->isSet("fullmode")) + dialog = new TDEDebugDialog(areaList, 0L); + else + { + TDEListDebugDialog * listdialog = new TDEListDebugDialog(areaList, 0L); + if (args->isSet("on")) + { + listdialog->activateArea( args->getOption("on"), true ); + /*listdialog->save(); + listdialog->config()->sync(); + return 0;*/ + } else if ( args->isSet("off") ) + { + listdialog->activateArea( args->getOption("off"), false ); + /*listdialog->save(); + listdialog->config()->sync(); + return 0;*/ + } + dialog = listdialog; + } + + /* Show dialog */ + int nRet = dialog->exec(); + if( nRet == TQDialog::Accepted ) + { + dialog->save(); + dialog->config()->sync(); + } + else + dialog->config()->rollback( true ); + + return 0; +} diff --git a/tdedebugdialog/tdedebugdialog.cpp b/tdedebugdialog/tdedebugdialog.cpp new file mode 100644 index 000000000..d63fac78b --- /dev/null +++ b/tdedebugdialog/tdedebugdialog.cpp @@ -0,0 +1,260 @@ +/* This file is part of the KDE libraries + Copyright (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) + Copyright (C) 1999 David Faure (faure@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "tdedebugdialog.h" + +TDEDebugDialog::TDEDebugDialog( TQStringList areaList, TQWidget *parent, const char *name, bool modal ) + : KAbstractDebugDialog( parent, name, modal ) +{ + setCaption(i18n("Debug Settings")); + + TQVBoxLayout *topLayout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); + if( topLayout == 0 ) { return; } // can this happen ? + + TQLabel * tmpLabel = new TQLabel( i18n("Debug area:"), this ); + tmpLabel->setFixedHeight( fontMetrics().lineSpacing() ); + topLayout->addWidget( tmpLabel ); + + // Build combo of debug areas + pDebugAreas = new TQComboBox( false, this ); + pDebugAreas->setFixedHeight( pDebugAreas->sizeHint().height() ); + pDebugAreas->insertStringList( areaList ); + topLayout->addWidget( pDebugAreas ); + + TQGridLayout *gbox = new TQGridLayout( 2, 2, KDialog::marginHint() ); + if( gbox == 0 ) { return; } + topLayout->addLayout( TQT_TQLAYOUT(gbox) ); + + TQStringList destList; + destList.append( i18n("File") ); + destList.append( i18n("Message Box") ); + destList.append( i18n("Shell") ); + destList.append( i18n("Syslog") ); + destList.append( i18n("None") ); + + // + // Upper left frame + // + pInfoGroup = new TQGroupBox( i18n("Information"), this ); + gbox->addWidget( pInfoGroup, 0, 0 ); + TQVBoxLayout *vbox = new TQVBoxLayout( pInfoGroup, KDialog::spacingHint() ); + vbox->addSpacing( fontMetrics().lineSpacing() ); + pInfoLabel1 = new TQLabel( i18n("Output to:"), pInfoGroup ); + vbox->addWidget( pInfoLabel1 ); + pInfoCombo = new TQComboBox( false, pInfoGroup ); + connect(pInfoCombo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotDestinationChanged(int))); + vbox->addWidget( pInfoCombo ); + pInfoCombo->insertStringList( destList ); + pInfoLabel2 = new TQLabel( i18n("Filename:"), pInfoGroup ); + vbox->addWidget( pInfoLabel2 ); + pInfoFile = new TQLineEdit( pInfoGroup ); + vbox->addWidget( pInfoFile ); + /* + pInfoLabel3 = new TQLabel( i18n("Show only area(s):"), pInfoGroup ); + vbox->addWidget( pInfoLabel3 ); + pInfoShow = new TQLineEdit( pInfoGroup ); + vbox->addWidget( pInfoShow ); + */ + + // + // Upper right frame + // + pWarnGroup = new TQGroupBox( i18n("Warning"), this ); + gbox->addWidget( pWarnGroup, 0, 1 ); + vbox = new TQVBoxLayout( pWarnGroup, KDialog::spacingHint() ); + vbox->addSpacing( fontMetrics().lineSpacing() ); + pWarnLabel1 = new TQLabel( i18n("Output to:"), pWarnGroup ); + vbox->addWidget( pWarnLabel1 ); + pWarnCombo = new TQComboBox( false, pWarnGroup ); + connect(pWarnCombo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotDestinationChanged(int))); + vbox->addWidget( pWarnCombo ); + pWarnCombo->insertStringList( destList ); + pWarnLabel2 = new TQLabel( i18n("Filename:"), pWarnGroup ); + vbox->addWidget( pWarnLabel2 ); + pWarnFile = new TQLineEdit( pWarnGroup ); + vbox->addWidget( pWarnFile ); + /* + pWarnLabel3 = new TQLabel( i18n("Show only area(s):"), pWarnGroup ); + vbox->addWidget( pWarnLabel3 ); + pWarnShow = new TQLineEdit( pWarnGroup ); + vbox->addWidget( pWarnShow ); + */ + + // + // Lower left frame + // + pErrorGroup = new TQGroupBox( i18n("Error"), this ); + gbox->addWidget( pErrorGroup, 1, 0 ); + vbox = new TQVBoxLayout( pErrorGroup, KDialog::spacingHint() ); + vbox->addSpacing( fontMetrics().lineSpacing() ); + pErrorLabel1 = new TQLabel( i18n("Output to:"), pErrorGroup ); + vbox->addWidget( pErrorLabel1 ); + pErrorCombo = new TQComboBox( false, pErrorGroup ); + connect(pErrorCombo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotDestinationChanged(int))); + vbox->addWidget( pErrorCombo ); + pErrorCombo->insertStringList( destList ); + pErrorLabel2 = new TQLabel( i18n("Filename:"), pErrorGroup ); + vbox->addWidget( pErrorLabel2 ); + pErrorFile = new TQLineEdit( pErrorGroup ); + vbox->addWidget( pErrorFile ); + /* + pErrorLabel3 = new TQLabel( i18n("Show only area(s):"), pErrorGroup ); + vbox->addWidget( pErrorLabel3 ); + pErrorShow = new TQLineEdit( pErrorGroup ); + vbox->addWidget( pErrorShow ); + */ + + // + // Lower right frame + // + pFatalGroup = new TQGroupBox( i18n("Fatal Error"), this ); + gbox->addWidget( pFatalGroup, 1, 1 ); + vbox = new TQVBoxLayout( pFatalGroup, KDialog::spacingHint() ); + vbox->addSpacing( fontMetrics().lineSpacing() ); + pFatalLabel1 = new TQLabel( i18n("Output to:"), pFatalGroup ); + vbox->addWidget( pFatalLabel1 ); + pFatalCombo = new TQComboBox( false, pFatalGroup ); + connect(pFatalCombo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotDestinationChanged(int))); + vbox->addWidget( pFatalCombo ); + pFatalCombo->insertStringList( destList ); + pFatalLabel2 = new TQLabel( i18n("Filename:"), pFatalGroup ); + vbox->addWidget( pFatalLabel2 ); + pFatalFile = new TQLineEdit( pFatalGroup ); + vbox->addWidget( pFatalFile ); + /* + pFatalLabel3 = new TQLabel( i18n("Show only area(s):"), pFatalGroup ); + vbox->addWidget( pFatalLabel3 ); + pFatalShow = new TQLineEdit( pFatalGroup ); + vbox->addWidget( pFatalShow ); + */ + + + pAbortFatal = new TQCheckBox( i18n("Abort on fatal errors"), this ); + topLayout->addWidget(pAbortFatal); + + topLayout->addStretch(); + KSeparator *hline = new KSeparator( KSeparator::HLine, this ); + topLayout->addWidget( hline ); + + buildButtons( topLayout ); + + connect( pDebugAreas, TQT_SIGNAL( activated( const TQString &) ), + TQT_SLOT( slotDebugAreaChanged( const TQString & ) ) ); + + // Get initial values ("initial" is understood by the slot) + slotDebugAreaChanged( "0 initial" ); + slotDestinationChanged(0); + + resize( 300, height() ); +} + +TDEDebugDialog::~TDEDebugDialog() +{ +} + +void TDEDebugDialog::slotDebugAreaChanged( const TQString & text ) +{ + // Save settings from previous page + if ( text != "0 initial" ) // except on first call + save(); + + TQString data = text.simplifyWhiteSpace(); + int space = data.find(" "); + if (space == -1) + kdError() << "No space:" << data << endl; + + bool longOK; + unsigned long number = data.left(space).toULong(&longOK); + if (!longOK) + kdError() << "The first part wasn't a number : " << data << endl; + + /* Fill dialog fields with values from config data */ + pConfig->setGroup( TQString::number( number ) ); // Group name = debug area code + pInfoCombo->setCurrentItem( pConfig->readNumEntry( "InfoOutput", 2 ) ); + pInfoFile->setText( pConfig->readPathEntry( "InfoFilename","kdebug.dbg" ) ); + //pInfoShow->setText( pConfig->readEntry( "InfoShow" ) ); + pWarnCombo->setCurrentItem( pConfig->readNumEntry( "WarnOutput", 2 ) ); + pWarnFile->setText( pConfig->readPathEntry( "WarnFilename","kdebug.dbg" ) ); + //pWarnShow->setText( pConfig->readEntry( "WarnShow" ) ); + pErrorCombo->setCurrentItem( pConfig->readNumEntry( "ErrorOutput", 2 ) ); + pErrorFile->setText( pConfig->readPathEntry( "ErrorFilename","kdebug.dbg") ); + //pErrorShow->setText( pConfig->readEntry( "ErrorShow" ) ); + pFatalCombo->setCurrentItem( pConfig->readNumEntry( "FatalOutput", 2 ) ); + pFatalFile->setText( pConfig->readPathEntry("FatalFilename","kdebug.dbg") ); + //pFatalShow->setText( pConfig->readEntry( "FatalShow" ) ); + pAbortFatal->setChecked( pConfig->readNumEntry( "AbortFatal", 1 ) ); + slotDestinationChanged(0); +} + +void TDEDebugDialog::save() +{ + pConfig->writeEntry( "InfoOutput", pInfoCombo->currentItem() ); + pConfig->writePathEntry( "InfoFilename", pInfoFile->text() ); + //pConfig->writeEntry( "InfoShow", pInfoShow->text() ); + pConfig->writeEntry( "WarnOutput", pWarnCombo->currentItem() ); + pConfig->writePathEntry( "WarnFilename", pWarnFile->text() ); + //pConfig->writeEntry( "WarnShow", pWarnShow->text() ); + pConfig->writeEntry( "ErrorOutput", pErrorCombo->currentItem() ); + pConfig->writePathEntry( "ErrorFilename", pErrorFile->text() ); + //pConfig->writeEntry( "ErrorShow", pErrorShow->text() ); + pConfig->writeEntry( "FatalOutput", pFatalCombo->currentItem() ); + pConfig->writePathEntry( "FatalFilename", pFatalFile->text() ); + //pConfig->writeEntry( "FatalShow", pFatalShow->text() ); + pConfig->writeEntry( "AbortFatal", pAbortFatal->isChecked() ); + + TQByteArray data; + if (!kapp->dcopClient()->send("*", "KDebug", "notifyKDebugConfigChanged()", data)) + { + kdError() << "Unable to send DCOP message" << endl; + } +} + +void TDEDebugDialog::slotDestinationChanged(int) { + pInfoFile->setEnabled(pInfoCombo->currentItem() == 0); + pWarnFile->setEnabled(pWarnCombo->currentItem() == 0); + pErrorFile->setEnabled(pErrorCombo->currentItem() == 0); + pFatalFile->setEnabled(pFatalCombo->currentItem() == 0); +} + +#include "tdedebugdialog.moc" diff --git a/tdedebugdialog/tdedebugdialog.h b/tdedebugdialog/tdedebugdialog.h new file mode 100644 index 000000000..dec300018 --- /dev/null +++ b/tdedebugdialog/tdedebugdialog.h @@ -0,0 +1,93 @@ +/* This file is part of the KDE libraries + Copyright (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef _TDEDEBUGDIALOG +#define _TDEDEBUGDIALOG + +#include "kabstractdebugdialog.h" + +class TQLineEdit; +class TQComboBox; +class TQLabel; +class TQGroupBox; +class TQCheckBox; +class TQPushButton; + +class TDEConfig; + +/** + * Control debug/warning/error/fatal output of TDE applications + * + * This dialog allows control of debugging output for all TDE apps. + * + * @author Kalle Dalheimer (kalle@kde.org) + */ +class TDEDebugDialog : public KAbstractDebugDialog +{ + Q_OBJECT + +public: + TDEDebugDialog( TQStringList areaList, TQWidget *parent=0, const char *name=0, bool modal=true ); + virtual ~TDEDebugDialog(); + + void save(); + +protected slots: + void slotDebugAreaChanged( const TQString & ); + void slotDestinationChanged(int); + +private: + TQComboBox* pDebugAreas; + TQGroupBox* pInfoGroup; + TQLabel* pInfoLabel1; + TQComboBox* pInfoCombo; + TQLabel* pInfoLabel2; + TQLineEdit* pInfoFile; + TQLabel* pInfoLabel3; + TQLineEdit* pInfoShow; + TQGroupBox* pWarnGroup; + TQLabel* pWarnLabel1; + TQComboBox* pWarnCombo; + TQLabel* pWarnLabel2; + TQLineEdit* pWarnFile; + TQLabel* pWarnLabel3; + TQLineEdit* pWarnShow; + TQGroupBox* pErrorGroup; + TQLabel* pErrorLabel1; + TQComboBox* pErrorCombo; + TQLabel* pErrorLabel2; + TQLineEdit* pErrorFile; + TQLabel* pErrorLabel3; + TQLineEdit* pErrorShow; + TQGroupBox* pFatalGroup; + TQLabel* pFatalLabel1; + TQComboBox* pFatalCombo; + TQLabel* pFatalLabel2; + TQLineEdit* pFatalFile; + TQLabel* pFatalLabel3; + TQLineEdit* pFatalShow; + + TQCheckBox* pAbortFatal; + +private: + // Disallow assignment and copy-construction + TDEDebugDialog( const TDEDebugDialog& ); + TDEDebugDialog& operator= ( const TDEDebugDialog& ); +}; + +#endif diff --git a/tdedebugdialog/tdelistdebugdialog.cpp b/tdedebugdialog/tdelistdebugdialog.cpp new file mode 100644 index 000000000..d447b3747 --- /dev/null +++ b/tdedebugdialog/tdelistdebugdialog.cpp @@ -0,0 +1,193 @@ +/* This file is part of the KDE libraries + Copyright (C) 2000 David Faure + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include "tdelistdebugdialog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +TDEListDebugDialog::TDEListDebugDialog( TQStringList areaList, TQWidget *parent, const char *name, bool modal ) + : KAbstractDebugDialog( parent, name, modal ), + m_areaList( areaList ) +{ + setCaption(i18n("Debug Settings")); + + TQVBoxLayout *lay = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); + + m_incrSearch = new KLineEdit( this ); + lay->addWidget( m_incrSearch ); + connect( m_incrSearch, TQT_SIGNAL( textChanged( const TQString& ) ), + TQT_SLOT( generateCheckBoxes( const TQString& ) ) ); + + TQScrollView * scrollView = new TQScrollView( this ); + scrollView->setResizePolicy( TQScrollView::AutoOneFit ); + lay->addWidget( scrollView ); + + m_box = new TQVBox( scrollView->viewport() ); + scrollView->addChild( m_box ); + + generateCheckBoxes( TQString::null ); + + TQHBoxLayout* selectButs = new TQHBoxLayout( lay ); + TQPushButton* all = new TQPushButton( i18n("&Select All"), this ); + TQPushButton* none = new TQPushButton( i18n("&Deselect All"), this ); + selectButs->addWidget( all ); + selectButs->addWidget( none ); + + connect( all, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selectAll() ) ); + connect( none, TQT_SIGNAL( clicked() ), this, TQT_SLOT( deSelectAll() ) ); + + buildButtons( lay ); + resize( 350, 400 ); +} + +void TDEListDebugDialog::generateCheckBoxes( const TQString& filter ) +{ + TQPtrListIterator cb_it ( boxes ); + for( ; cb_it.current() ; ++cb_it ) + { + if( (*cb_it)->state() != TQButton::NoChange ) + m_changes.insert( (*cb_it)->name(), (*cb_it)->isChecked() ? 2 : 4 ); + } + + boxes.setAutoDelete( true ); + boxes.clear(); + boxes.setAutoDelete( false ); + + TQWidget* taborder = m_incrSearch; + TQStringList::Iterator it = m_areaList.begin(); + for ( ; it != m_areaList.end() ; ++it ) + { + TQString data = (*it).simplifyWhiteSpace(); + if ( filter.isEmpty() || data.lower().contains( filter.lower() ) ) + { + int space = data.find(" "); + if (space == -1) + kdError() << "No space:" << data << endl; + + TQString areaNumber = data.left(space); + //kdDebug() << areaNumber << endl; + TQCheckBox * cb = new TQCheckBox( data, m_box, areaNumber.latin1() ); + cb->show(); + boxes.append( cb ); + setTabOrder( taborder, cb ); + taborder = cb; + } + } + + load(); +} + +void TDEListDebugDialog::selectAll() +{ + TQPtrListIterator it ( boxes ); + for ( ; it.current() ; ++it ) { + (*it)->setChecked( true ); + m_changes.insert( (*it)->name(), 2 ); + } +} + +void TDEListDebugDialog::deSelectAll() +{ + TQPtrListIterator it ( boxes ); + for ( ; it.current() ; ++it ) { + (*it)->setChecked( false ); + m_changes.insert( (*it)->name(), 4 ); + } +} + +void TDEListDebugDialog::load() +{ + TQPtrListIterator it ( boxes ); + for ( ; it.current() ; ++it ) + { + pConfig->setGroup( (*it)->name() ); // Group name = debug area code = cb's name + + int setting = pConfig->readNumEntry( "InfoOutput", 2 ); + // override setting if in m_changes + if( m_changes.find( (*it)->name() ) != m_changes.end() ) { + setting = m_changes[ (*it)->name() ]; + } + + switch (setting) { + case 4: // off + (*it)->setChecked(false); + break; + case 2: //shell + (*it)->setChecked(true); + break; + case 3: //syslog + case 1: //msgbox + case 0: //file + default: + (*it)->setNoChange(); + /////// Uses the triState capability of checkboxes + ////// Note: it seems some styles don't draw that correctly (BUG) + break; + } + } +} + +void TDEListDebugDialog::save() +{ + TQPtrListIterator it ( boxes ); + for ( ; it.current() ; ++it ) + { + pConfig->setGroup( (*it)->name() ); // Group name = debug area code = cb's name + if ( (*it)->state() != TQButton::NoChange ) + { + int setting = (*it)->isChecked() ? 2 : 4; + pConfig->writeEntry( "InfoOutput", setting ); + } + } + //sync done by main.cpp + + // send DCOP message to all clients + TQByteArray data; + if (!kapp->dcopClient()->send("*", "KDebug", "notifyKDebugConfigChanged()", data)) + { + kdError() << "Unable to send DCOP message" << endl; + } + + m_changes.clear(); +} + +void TDEListDebugDialog::activateArea( TQCString area, bool activate ) +{ + TQPtrListIterator it ( boxes ); + for ( ; it.current() ; ++it ) + { + if ( area == (*it)->name() // debug area code = cb's name + || (*it)->text().find( TQString::fromLatin1(area) ) != -1 ) // area name included in cb text + { + (*it)->setChecked( activate ); + return; + } + } +} + +#include "tdelistdebugdialog.moc" diff --git a/tdedebugdialog/tdelistdebugdialog.h b/tdedebugdialog/tdelistdebugdialog.h new file mode 100644 index 000000000..92e68d2be --- /dev/null +++ b/tdedebugdialog/tdelistdebugdialog.h @@ -0,0 +1,65 @@ +/* This file is part of the KDE libraries + Copyright (C) 2000 David Faure + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef TDELISTDEBUGDIALOG__H +#define TDELISTDEBUGDIALOG__H + +#include "kabstractdebugdialog.h" +#include +#include +#include + +class TQVBox; +class KLineEdit; + +/** + * Control debug output of TDE applications + * This dialog offers a reduced functionality compared to the full TDEDebugDialog + * class, but allows to set debug output on or off to several areas much more easily. + * + * @author David Faure + */ +class TDEListDebugDialog : public KAbstractDebugDialog +{ + Q_OBJECT + +public: + TDEListDebugDialog( TQStringList areaList, TQWidget *parent=0, const char *name=0, bool modal=true ); + virtual ~TDEListDebugDialog() {} + + void activateArea( TQCString area, bool activate ); + + virtual void save(); + +protected slots: + void selectAll(); + void deSelectAll(); + + void generateCheckBoxes( const TQString& filter ); + +private: + void load(); + TQPtrList boxes; + TQStringList m_areaList; + TQVBox *m_box; + KLineEdit *m_incrSearch; + TQMap m_changes; +}; + +#endif diff --git a/tdeioslave/sftp/DEBUGGING b/tdeioslave/sftp/DEBUGGING index 89ae8fe18..8e15c91d4 100644 --- a/tdeioslave/sftp/DEBUGGING +++ b/tdeioslave/sftp/DEBUGGING @@ -1,7 +1,7 @@ DEBUGGING The best way to debug this slave is to send debug info to a -file using 'kdebugDialog --fullmode'. Then you can 'tail -f' the file to +file using 'tdedebugDialog --fullmode'. Then you can 'tail -f' the file to see debug messages in real-time. I also suggest getting the openssh source and recompiling sftp-server to -- cgit v1.2.3