katemdi.cpp

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2005 Christoph Cullmann <cullmann@kde.org>
00003    Copyright (C) 2002, 2003 Joseph Wenninger <jowenn@kde.org>
00004 
00005    GUIClient partly based on ktoolbarhandler.cpp: Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include "katemdi.h"
00024 #include "katemdi.moc"
00025 
00026 #include <kaction.h>
00027 #include <kdebug.h>
00028 #include <kglobal.h>
00029 #include <kglobalsettings.h>
00030 #include <kapplication.h>
00031 #include <klocale.h>
00032 #include <kconfig.h>
00033 #include <kiconloader.h>
00034 #include <kpopupmenu.h>
00035 #include <kmessagebox.h>
00036 
00037 #include <qvbox.h>
00038 #include <qhbox.h>
00039 #include <qevent.h>
00040 
00041 namespace KateMDI {
00042 
00043 //BEGIN SPLITTER
00044 
00045 Splitter::Splitter(Orientation o, QWidget* parent, const char* name)
00046   : QSplitter(o, parent, name)
00047 {
00048 }
00049 
00050 Splitter::~Splitter()
00051 {
00052 }
00053 
00054 bool Splitter::isLastChild(QWidget* w) const
00055 {
00056   return ( idAfter( w ) == 0 );
00057 }
00058 
00059 int Splitter::idAfter ( QWidget * w ) const
00060 {
00061   return QSplitter::idAfter (w);
00062 }
00063 
00064 //END SPLITTER
00065 
00066 
00067 //BEGIN TOGGLETOOLVIEWACTION
00068 
00069 ToggleToolViewAction::ToggleToolViewAction ( const QString& text, const KShortcut& cut, ToolView *tv,
00070                                              QObject* parent, const char* name )
00071  : KToggleAction(text,cut,parent,name)
00072  , m_tv(tv)
00073 {
00074   connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
00075   connect(m_tv,SIGNAL(visibleChanged(bool)),this,SLOT(visibleChanged(bool)));
00076 
00077   setChecked(m_tv->visible());
00078 }
00079 
00080 ToggleToolViewAction::~ToggleToolViewAction()
00081 {
00082   unplugAll();
00083 }
00084 
00085 void ToggleToolViewAction::visibleChanged(bool)
00086 {
00087   if (isChecked() != m_tv->visible())
00088     setChecked (m_tv->visible());
00089 }
00090 
00091 void ToggleToolViewAction::slotToggled(bool t)
00092 {
00093   if (t)
00094   {
00095     m_tv->mainWindow()->showToolView (m_tv);
00096     m_tv->setFocus ();
0009a>()="comment">   Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include "katemdi.h"
00024 #include "katemdi.moc"
00025 
00026 #include <kaction.h>
00027 #include <kdebug.h>
00028 #include <kglobal.h>
00029 #include <kglobalsettings.h>
00030 #include <kapplication.h>
00031 #include <klocale.h>
00032 #include <kconfig.h>
00033 #include <kiconloader.h>
00034 #include <kpopupmenu.h>
00035 #include <kmessagebox.h>
00036 
00037 #include <qvbox.h>
00038 #include <qhbox.h>
00039 #include <qevent.h>
00040 
00041 namespace KateMDI {
00042 
00043 //BEGIN SPLITTER
00044 
00045 Splitter::Splitter(Orientation o, QWidget* parent, const char* name)
00046   : QSplitter(o, parent, name)
00047 {
00048 }
00049 
00050 Splitter::~Splitter()
00051 {
00052 }
00053 
00054 bool Splitter::isLastChild(QWidget* w) const
00055 {
00056   return ( idAfter( w ) == 0 );
00057 }
00058 
00059 int Splitter::idAfter ( QWidget * w ) const
00060 {
00061   return QSplitter::idAfter (w);
00062 }
00063 
00064 //END SPLITTER
00065 
00066 
00067 //BEGIN TOGGLETOOLVIEWACTION
00068 
00069 ToggleToolViewAction::ToggleToolViewAction ( const QString& text, const KShortcut& cut, ToolView *tv,
00070                                              QObject* parent, const char* name )
00071  : KToggleAction(text,cut,parent,name)
00072  , m_tv(tv)
00073 {
00074   connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
00075   connect(m_tv,SIGNAL(visibleChanged(bool)),this,SLOT(visibleChanged(bool)));
00076 
00077   setChecked(m_tv->visible());
00078 }
00079 
00080 ToggleToolViewAction::~ToggleToolViewAction()
00081 {
00082   unplugAll();
00083 }
00084 
00085 void ToggleToolViewAction::visibleChanged(bool)
00086 {
00087   if (isChecked() != m_tv->visible())
00088     setChecked (m_tv->visible());
00089 }
00090 
00091 void ToggleToolViewAction::slotToggled(bool t)
00092 {
00093   if (t)
00094   {
00095     m_tv->mainWindow()->showToolView (m_tv);
00096     m_tv->setFocus ();
0009a>()="comment">   Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include "katemdi.h"
00024 #include "katemdi.moc"
00025 
00026 #include <kaction.h>
00027 #include <kdebug.h>
00028 #include <kglobal.h>
00029 #include <kglobalsettings.h>
00030 #include <kapplication.h>
00031 #include <klocale.h>
00032 #include <kconfig.h>
00033 #include <kiconloader.h>
00034 #include <kpopupmenu.h>
00035 #include <kmessagebox.h>
00036 
00037 #include <qvbox.h>
00038 #include <qhbox.h>
00039 #include <qevent.h>
00040 
00041 namespace KateMDI {
00042 
00043 //BEGIN SPLITTER
00044 
00045 Splitter::Splitter(Orientation o, QWidget* parent, const char* name)
00046   : QSplitter(o, parent, name)
00047 {
00048 }
00049 
00050 Splitter::~Splitter()
00051 {
00052 }
00053 
00054 bool Splitter::isLastChild(QWidget* w) const
00055 {
00056   return ( idAfter( w ) == 0 );
00057 }
00058 
00059 int Splitter::idAfter ( QWidget * w ) const
00060 {
00061   return QSplitter::idAfter (w);
00062 }
00063 
00064 //END SPLITTER
00065 
00066 
00067 //BEGIN TOGGLETOOLVIEWACTION
00068 
00069 ToggleToolViewAction::ToggleToolViewAction ( const QString& text, const KShortcut& cut, ToolView *tv,
00070                                              QObject* parent, const char* name )
00071  : KToggleAction(text,cut,parent,name)
00072  , m_tv(tv)
00073 {
00074   connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
00075   connect(m_tv,SIGNAL(visibleChanged(bool)),this,SLOT(visibleChanged(bool)));
00076 
00077   setChecked(m_tv->visible());
00078 }
00079 
00080 ToggleToolViewAction::~ToggleToolViewAction()
00081 {
00082   unplugAll();
00083 }
00084 
00085 void ToggleToolViewAction::visibleChanged(bool)
00086 {
00087   if (isChecked() != m_tv->visible())
00088     setChecked (m_tv->visible());
00089 }
00090 
00091 void ToggleToolViewAction::slotToggled(bool t)
00092 {
00093   if (t)
00094   {
00095     m_tv->mainWindow()->showToolView (m_tv);
00096     m_tv->setFocus ();
0009a>()="comment">   Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include "katemdi.h"
00024 #include "katemdi.moc"
00025 
00026 #include <kaction.h>
00027 #include <kdebug.h>
00028 #include <kglobal.h>
00029 #include <kglobalsettings.h>
00030 #include <kapplication.h>
00031 #include <klocale.h>
00032 #include <kconfig.h>
00033 #include <kiconloader.h>
00034 #include <kpopupmenu.h>
00035 #include <kmessagebox.h>
00036 
00037 #include <qvbox.h>
00038 #include <qhbox.h>
00039 #include <qevent.h>
00040 
00041 namespace KateMDI {
00042 
00043 //BEGIN SPLITTER
00044 
00045 Splitter::Splitter(Orientation o, QWidget* parent, const char* name)
00046   : QSplitter(o, parent, name)
00047 {
00048 }
00049 
00050 Splitter::~Splitter()
00051 {
00052 }
00053 
00054 bool Splitter::isLastChild(QWidget* w) const
00055 {
00056   return ( idAfter( w ) == 0 );
00057 }
00058 
00059 int Splitter::idAfter ( QWidget * w ) const
00060 {
00061   return QSplitter::idAfter (w);
00062 }
00063 
00064 //END SPLITTER
00065 
00066 
00067 //BEGIN TOGGLETOOLVIEWACTION
00068 
00069 ToggleToolViewAction::ToggleToolViewAction ( const QString& text, const KShortcut& cut, ToolView *tv,
00070                                              QObject* parent, const char* name )
00071  : KToggleAction(text,cut,parent,name)
00072  , m_tv(tv)
00073 {
00074   connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
00075   connect(m_tv,SIGNAL(visibleChanged(bool)),this,SLOT(visibleChanged(bool)));
00076 
00077   setChecked(m_tv->visible());
00078 }
00079 
00080 ToggleToolViewAction::~ToggleToolViewAction()
00081 {
00082   unplugAll();
00083 }
00084 
00085 void ToggleToolViewAction::visibleChanged(bool)
00086 {
00087   if (isChecked() != m_tv->visible())
00088     setChecked (m_tv->visible());
00089 }
00090 
00091 void ToggleToolViewAction::slotToggled(bool t)
00092 {
00093   if (t)
00094   {
00095     m_tv->mainWindow()->showToolView (m_tv);
00096     m_tv->setFocus ();
0009a>()="comment">   Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include "katemdi.h"
00024 #include "katemdi.moc"
00025 
00026 #include <kaction.h>
00027 #include <kdebug.h>
00028 #include <kglobal.h>
00029 #include <kglobalsettings.h>
00030 #include <kapplication.h>
00031 #include <klocale.h>
00032 #include <kconfig.h>
00033 #include <kiconloader.h>
00034 #include <kpopupmenu.h>
00035 #include <kmessagebox.h>
00036 
00037 #include <qvbox.h>
00038 #include <qhbox.h>
00039 #include <qevent.h>
00040 
00041 namespace KateMDI {
00042 
00043 //BEGIN SPLITTER
00044 
00045 Splitter::Splitter(Orientation o, QWidget* parent, const char* name)
00046   : QSplitter(o, parent, name)
00047 {
00048 }
00049 
00050 Splitter::~Splitter()
00051 {
00052 }
00053 
00054 bool Splitter::isLastChild(QWidget* w) const
00055 {
00056   return ( idAfter( w ) == 0 );
00057 }
00058 
00059 int Splitter::idAfter ( QWidget * w ) const
00060 {
00061   return QSplitter::idAfter (w);
00062 }
00063 
00064 //END SPLITTER
00065 
00066 
00067 //BEGIN TOGGLETOOLVIEWACTION
00068 
00069 ToggleToolViewAction::ToggleToolViewAction ( const QString& text, const KShortcut& cut, ToolView *tv,
00070                                              QObject* parent, const char* name )
00071  : KToggleAction(text,cut,parent,name)
00072  , m_tv(tv)
00073 {
00074   connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
00075   connect(m_tv,SIGNAL(visibleChanged(bool)),this,SLOT(visibleChanged(bool)));
00076 
00077   setChecked(m_tv->visible());
00078 }
00079 
00080 ToggleToolViewAction::~ToggleToolViewAction()
00081 {
00082   unplugAll();
00083 }
00084 
00085 void ToggleToolViewAction::visibleChanged(bool)
00086 {
00087   if (isChecked() != m_tv->visible())
00088     setChecked (m_tv->visible());
00089 }
00090 
00091 void ToggleToolViewAction::slotToggled(bool t)
00092 {
00093   if (t)
00094   {
00095     m_tv->mainWindow()->showToolView (m_tv);
00096     m_tv->setFocus ();
0009a>()="comment">   Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include "katemdi.h"
00024 #include "katemdi.moc"
00025 
00026 #include <kaction.h>
00027 #include <kdebug.h>
00028 #include <kglobal.h>
00029 #include <kglobalsettings.h>
00030 #include <kapplication.h>
00031 #include <klocale.h>
00032 #include <kconfig.h>
00033 #include <kiconloader.h>
00034 #include <kpopupmenu.h>
00035 #include <kmessagebox.h>
00036 
00037 #include <qvbox.h>
00038 #include <qhbox.h>
00039 #include <qevent.h>
00040 
00041 namespace KateMDI {
00042 
00043 //BEGIN SPLITTER
00044 
00045 Splitter::Splitter(Orientation o, QWidget* parent, const char* name)
00046   : QSplitter(o, parent, name)
00047 {
00048 }
00049 
00050 Splitter::~Splitter()
00051 {
00052 }
00053 
00054 bool Splitter::isLastChild(QWidget* w) const
00055 {
00056   return ( idAfter( w ) == 0 );
00057 }
00058 
00059 int Splitter::idAfter ( QWidget * w ) const
00060 {
00061   return QSplitter::idAfter (w);
00062 }
00063 
00064 //END SPLITTER
00065 
00066 
00067 //BEGIN TOGGLETOOLVIEWACTION
00068 
00069 ToggleToolViewAction::ToggleToolViewAction ( const QString& text, const KShortcut& cut, ToolView *tv,
00070                                              QObject* parent, const char* name )
00071  : KToggleAction(text,cut,parent,name)
00072  , m_tv(tv)
00073 {
00074   connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
00075   connect(m_tv,SIGNAL(visibleChanged(bool)),this,SLOT(visibleChanged(bool)));
00076 
00077   setChecked(m_tv->visible());
00078 }
00079 
00080 ToggleToolViewAction::~ToggleToolViewAction()
00081 {
00082   unplugAll();
00083 }
00084 
00085 void ToggleToolViewAction::visibleChanged(bool)
00086 {
00087   if (isChecked() != m_tv->visible())
00088     setChecked (m_tv->visible());
00089 }
00090 
00091 void ToggleToolViewAction::slotToggled(bool t)
00092 {
00093   if (t)
00094   {
00095     m_tv->mainWindow()->showToolView (m_tv);
00096     m_tv->setFocus ();
0009a>()="comment">   Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include "katemdi.h"
00024 #include "katemdi.moc"
00025 
00026 #include <kaction.h>
00027 #include <kdebug.h>
00028 #include <kglobal.h>
00029 #include <kglobalsettings.h>
00030 #include <kapplication.h>
00031 #include <klocale.h>
00032 #include <kconfig.h>
00033 #include <kiconloader.h>
00034 #include <kpopupmenu.h>
00035 #include <kmessagebox.h>
00036 
00037 #include <qvbox.h>
00038 #include <qhbox.h>
00039 #include <qevent.h>
00040 
00041 namespace KateMDI {
00042 
00043 //BEGIN SPLITTER
00044 
00045 Splitter::Splitter(Orientation o, QWidget* parent, const char* name)
00046   : QSplitter(o, parent, name)
00047 {
00048 }
00049 
00050 Splitter::~Splitter()
00051 {
00052 }
00053 
00054 bool Splitter::isLastChild(QWidget* w) const
00055 {
00056   return ( idAfter( w ) == 0 );
00057 }
00058 
00059 int Splitter::idAfter ( QWidget * w ) const
00060 {
00061   return QSplitter::idAfter (w);
00062 }
00063 
00064 //END SPLITTER
00065 
00066 
00067 //BEGIN TOGGLETOOLVIEWACTION
00068 
00069 ToggleToolViewAction::ToggleToolViewAction ( const QString& text, const KShortcut& cut, ToolView *tv,
00070                                              QObject* parent, const char* name )
00071  : KToggleAction(text,cut,parent,name)
00072  , m_tv(tv)
00073 {
00074   connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
00075   connect(m_tv,SIGNAL(visibleChanged(bool)),this,SLOT(visibleChanged(bool)));
00076 
00077   setChecked(m_tv->visible());
00078 }
00079 
00080 ToggleToolViewAction::~ToggleToolViewAction()
00081 {
00082   unplugAll();
00083 }
00084 
00085 void ToggleToolViewAction::visibleChanged(bool)
00086 {
00087   if (isChecked() != m_tv->visible())
00088     setChecked (m_tv->visible());
00089 }
00090 
00091 void ToggleToolViewAction::slotToggled(bool t)
00092 {
00093   if (t)
00094   {
00095     m_tv->mainWindow()->showToolView (m_tv);
00096     m_tv->setFocus ();
0009a>()="comment">   Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include "katemdi.h"
00024 #include "katemdi.moc"
00025 
00026 #include <kaction.h>
00027 #include <kdebug.h>
00028 #include <kglobal.h>
00029 #include <kglobalsettings.h>
00030 #include <kapplication.h>
00031 #include <klocale.h>
00032 #include <kconfig.h>
00033 #include <kiconloader.h>
00034 #include <kpopupmenu.h>
00035 #include <kmessagebox.h>
00036 
00037 #include <qvbox.h>
00038 #include <qhbox.h>
00039 #include <qevent.h>
00040 
00041 namespace KateMDI {
00042 
00043 //BEGIN SPLITTER
00044 
00045 Splitter::Splitter(Orientation o, QWidget* parent, const char* name)
00046   : QSplitter(o, parent, name)
00047 {
00048 }
00049 
00050 Splitter::~Splitter()
00051 {
00052 }
00053 
00054 bool Splitter::isLastChild(QWidget* w) const
00055 {
00056   return ( idAfter( w ) == 0 );
00057 }
00058 
00059 int Splitter::idAfter ( QWidget * w ) const
00060 {
00061   return QSplitter::idAfter (w);
00062 }
00063 
00064 //END SPLITTER
00065 
00066 
00067 //BEGIN TOGGLETOOLVIEWACTION
00068 
00069 ToggleToolViewAction::ToggleToolViewAction ( const QString& text, const KShortcut& cut, ToolView *tv,
00070                                              QObject* parent, const char* name )
00071  : KToggleAction(text,cut,parent,name)
00072  , m_tv(tv)
00073 {
00074   connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
00075   connect(m_tv,SIGNAL(visibleChanged(bool)),this,SLOT(visibleChanged(bool)));
00076 
00077   setChecked(m_tv->visible());
00078 }
00079 
00080 ToggleToolViewAction::~ToggleToolViewAction()
00081 {
00082   unplugAll();
00083 }
00084 
00085 void ToggleToolViewAction::visibleChanged(bool)
00086 {
00087   if (isChecked() != m_tv->visible())
00088     setChecked (m_tv->visible());
00089 }
00090 
00091 void ToggleToolViewAction::slotToggled(bool t)
00092 {
00093   if (t)
00094   {
00095     m_tv->mainWindow()->showToolView (m_tv);
00096     m_tv->setFocus ();
0009a>()="comment">   Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include "katemdi.h"
00024 #include "katemdi.moc"
00025 
00026 #include <kaction.h>
00027 #include <kdebug.h>
00028 #include <kglobal.h>
00029 #include <kglobalsettings.h>
00030 #include <kapplication.h>
00031 #include <klocale.h>
00032 #include <kconfig.h>
00033 #include <kiconloader.h>
00034 #include <kpopupmenu.h>
00035 #include <kmessagebox.h>
00036 
00037 #include <qvbox.h>
00038 #include <qhbox.h>
00039 #include <qevent.h>
00040 
00041 namespace KateMDI {
00042 
00043 //BEGIN SPLITTER
00044 
00045 Splitter::Splitter(Orientation o, QWidget* parent, const char* name)
00046   : QSplitter(o, parent, name)
00047 {
00048 }
00049 
00050 Splitter::~Splitter()
00051 {
00052 }
00053 
00054 bool Splitter::isLastChild(QWidget* w) const
00055 {
00056   return ( idAfter( w ) == 0 );
00057 }
00058 
00059 int Splitter::idAfter ( QWidget * w ) const
00060 {
00061   return QSplitter::idAfter (w);
00062 }
00063 
00064 //END SPLITTER
00065 
00066 
00067 //BEGIN TOGGLETOOLVIEWACTION
00068 
00069 ToggleToolViewAction::ToggleToolViewAction ( const QString& text, const KShortcut& cut, ToolView *tv,
00070                                              QObject* parent, const char* name )
00071  : KToggleAction(text,cut,parent,name)
00072  , m_tv(tv)
00073 {
00074   connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
00075   connect(m_tv,SIGNAL(visibleChanged(bool)),this,SLOT(visibleChanged(bool)));
00076 
00077   setChecked(m_tv->visible());
00078 }
00079 
00080 ToggleToolViewAction::~ToggleToolViewAction()
00081 {
00082   unplugAll();
00083 }
00084 
00085 void ToggleToolViewAction::visibleChanged(bool)
00086 {
00087   if (isChecked() != m_tv->visible())
00088     setChecked (m_tv->visible());
00089 }
00090 
00091 void ToggleToolViewAction::slotToggled(bool t)
00092 {
00093   if (t)
00094   {
00095     m_tv->mainWindow()->showToolView (m_tv);
00096     m_tv->setFocus ();
0009a>()="comment">   Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include "katemdi.h"
00024 #include "katemdi.moc"
00025 
00026 #include <kaction.h>
00027 #include <kdebug.h>
00028 #include <kglobal.h>
00029 #include <kglobalsettings.h>
00030 #include <kapplication.h>
00031 #include <klocale.h>
00032 #include <kconfig.h>
00033 #include <kiconloader.h>
00034 #include <kpopupmenu.h>
00035 #include <kmessagebox.h>
00036 
00037 #include <qvbox.h>
00038 #include <qhbox.h>
00039 #include <qevent.h>
00040 
00041 namespace KateMDI {
00042 
00043 //BEGIN SPLITTER
00044 
00045 Splitter::Splitter(Orientation o, QWidget* parent, const char* name)
00046   : QSplitter(o, parent, name)
00047 {
00048 }
00049 
00050 Splitter::~Splitter()
00051 {
00052 }
00053 
00054 bool Splitter::isLastChild(QWidget* w) const
00055 {
00056   return ( idAfter( w ) == 0 );
00057 }
00058 
00059 int Splitter::idAfter ( QWidget * w ) const
00060 {
00061   return QSplitter::idAfter (w);
00062 }
00063 
00064 //END SPLITTER
00065 
00066 
00067 //BEGIN TOGGLETOOLVIEWACTION
00068 
00069 ToggleToolViewAction::ToggleToolViewAction ( const QString& text, const KShortcut& cut, ToolView *tv,
00070                                              QObject* parent, const char* name )
00071  : KToggleAction(text,cut,parent,name)
00072  , m_tv(tv)
00073 {
00074   connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
00075   connect(m_tv,SIGNAL(visibleChanged(bool)),this,SLOT(visibleChanged(bool)));
00076 
00077   setChecked(m_tv->visible());
00078 }
00079 
00080 ToggleToolViewAction::~ToggleToolViewAction()
00081 {
00082   unplugAll();
00083 }
00084 
00085 void ToggleToolViewAction::visibleChanged(bool)
00086 {
00087   if (isChecked() != m_tv->visible())
00088     setChecked (m_tv->visible());
00089 }
00090 
00091 void ToggleToolViewAction::slotToggled(bool t)
00092 {
00093   if (t)
00094   {
00095     m_tv->mainWindow()->showToolView (m_tv);
00096     m_tv->setFocus ();
0009a>()="comment">   Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include "katemdi.h"
00024 #include "katemdi.moc"
00025 
00026 #include <kaction.h>
00027 #include <kdebug.h>
00028 #include <kglobal.h>
00029 #include <kglobalsettings.h>
00030 #include <kapplication.h>
00031 #include <klocale.h>
00032 #include <kconfig.h>
00033 #include <kiconloader.h>
00034 #include <kpopupmenu.h>
00035 #include <kmessagebox.h>
00036 
00037 #include <qvbox.h>
00038 #include <qhbox.h>
00039 #include <qevent.h>
00040 
00041 namespace KateMDI {
00042 
00043 //BEGIN SPLITTER
00044 
00045 Splitter::Splitter(Orientation o, QWidget* parent, const char* name)
00046   : QSplitter(o, parent, name)
00047 {
00048 }
00049 
00050 Splitter::~Splitter()
00051 {
00052 }
00053 
00054 bool Splitter::isLastChild(QWidget* w) const
00055 {
00056   return ( idAfter( w ) == 0 );
00057 }
00058 
00059 int Splitter::idAfter ( QWidget * w ) const
00060 {
00061   return QSplitter::idAfter (w);
00062 }
00063 
00064 //END SPLITTER
00065 
00066 
00067 //BEGIN TOGGLETOOLVIEWACTION
00068 
00069 ToggleToolViewAction::ToggleToolViewAction ( const QString& text, const KShortcut& cut, ToolView *tv,
00070                                              QObject* parent, const char* name )
00071  : KToggleAction(text,cut,parent,name)
00072  , m_tv(tv)
00073 {
00074   connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
00075   connect(m_tv,SIGNAL(visibleChanged(bool)),this,SLOT(visibleChanged(bool)));
00076 
00077   setChecked(m_tv->visible());
00078 }
00079 
00080 ToggleToolViewAction::~ToggleToolViewAction()
00081 {
00082   unplugAll();
00083 }
00084 
00085 void ToggleToolViewAction::visibleChanged(bool)
00086 {
00087   if (isChecked() != m_tv->visible())
00088     setChecked (m_tv->visible());
00089 }
00090 
00091 void ToggleToolViewAction::slotToggled(bool t)
00092 {
00093   if (t)
00094   {
00095     m_tv->mainWindow()->showToolView (m_tv);
00096     m_tv->setFocus ();
0009a>()="comment">   Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #include "katemdi.h"
00024 #include "katemdi.moc"
00025 
00026 #include <kaction.h>
00027 #include <kdebug.h>
00028 #include <kglobal.h>
00029 #include <kglobalsettings.h>
00030 #include <kapplication.h>
00031 #include <klocale.h>
00032 #include <kconfig.h>
00033 #include <kiconloader.h>
00034 #include <kpopupmenu.h>
00035 #include <kmessagebox.h>
00036 
00037 #include <qvbox.h>
00038 #include <qhbox.h>
00039 #include <qevent.h>
00040 
00041