1
//=============================================================================
3
// File : kvi_debugwindow.cpp
4
// Creation date : Sun Jul 18 2005 14:12:22 by Szymon Stefanek
6
// This file is part of the KVirc irc client distribution
7
// Copyright (C) 2005-2008 Szymon Stefanek (pragma at kvirc dot net)
9
// This program is FREE software. You can redistribute it and/or
10
// modify it under the terms of the GNU General Public License
11
// as published by the Free Software Foundation; either version 2
12
// of the License, or (at your opinion) any later version.
14
// This program is distributed in the HOPE that it will be USEFUL,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
// See the GNU General Public License for more details.
19
// You should have received a copy of the GNU General Public License
20
// along with this program. If not, write to the Free Software Foundation,
21
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
//=============================================================================
26
#include "kvi_debugwindow.h"
27
#include "kvi_console.h"
28
#include "kvi_iconmanager.h"
29
#include "kvi_ircview.h"
30
#include "kvi_input.h"
31
#include "kvi_options.h"
32
#include "kvi_locale.h"
33
#include "kvi_config.h"
35
#include "kvi_parameterlist.h"
36
#include "kvi_frame.h"
41
KviDebugWindow * KviDebugWindow::m_pInstance = 0;
44
KviDebugWindow::KviDebugWindow()
45
: KviWindow(KVI_WINDOW_TYPE_DEBUG,g_pFrame,__tr2qs("Debug Messages"),0)
48
m_pSplitter = new KviTalSplitter(Qt::Horizontal,this);
49
m_pSplitter->setObjectName("main_splitter");
50
m_pIrcView = new KviIrcView(m_pSplitter,g_pFrame,this);
51
m_pInput = new KviInput(this,0);
55
KviDebugWindow::~KviDebugWindow()
60
KviDebugWindow * KviDebugWindow::getInstance()
62
if(m_pInstance)return m_pInstance;
63
m_pInstance = new KviDebugWindow();
64
g_pFrame->addWindow(m_pInstance,!KVI_OPTION_BOOL(KviOption_boolShowMinimizedDebugWindow));
65
if(KVI_OPTION_BOOL(KviOption_boolShowMinimizedDebugWindow))
66
m_pInstance->minimize();
70
void KviDebugWindow::getBaseLogFileName(QString &buffer)
75
void KviDebugWindow::saveProperties(KviConfig *cfg)
77
KviWindow::saveProperties(cfg);
78
cfg->writeEntry("Splitter",m_pSplitter->sizes());
81
void KviDebugWindow::loadProperties(KviConfig *cfg)
84
KviWindow::loadProperties(cfg);
86
def.append((w * 80) / 100);
87
def.append((w * 20) / 100);
88
m_pSplitter->setSizes(cfg->readIntListEntry("Splitter",def));
91
void KviDebugWindow::fillCaptionBuffers()
93
m_szPlainTextCaption = windowName();
96
QPixmap * KviDebugWindow::myIconPtr()
98
return g_pIconManager->getSmallIcon(KVI_SMALLICON_BUG);
101
void KviDebugWindow::resizeEvent(QResizeEvent *)
103
int hght = m_pInput->heightHint();
104
m_pSplitter->setGeometry(0,0,width(),height() - hght);
105
m_pInput->setGeometry(0,height() - hght,width(),hght);
108
QSize KviDebugWindow::sizeHint() const
110
QSize ret(m_pSplitter->sizeHint().width(),m_pIrcView->sizeHint().height() + m_pInput->heightHint());