~ubuntu-branches/ubuntu/trusty/kvirc/trusty

« back to all changes in this revision

Viewing changes to src/kvirc/ui/kvi_debugwindow.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kai Wasserbäch, Kai Wasserbäch, Raúl Sánchez Siles
  • Date: 2011-02-12 10:40:21 UTC
  • mfrom: (14.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110212104021-5mh4f75jlku20mnt
The combined "Twisted Experiment" and "Nocturnal Raid" release.

[ Kai Wasserbäch ]
* Synced to upstream's SVN revision 5467.
* debian/rules:
  - Added .PHONY line.
  - Resurrect -DMANUAL_REVISION, got lost somewhere and we build SVN
    revisions again.
  - Replace "-DWITH_NO_EMBEDDED_CODE=YES" with "-DWANT_CRYPTOPP=YES".
  - Change the remaining -DWITH/-DWITHOUT to the new -DWANT syntax.
* debian/control:
  - Removed DMUA, I'm a DD now.
  - Changed my e-mail address.
  - Removed unneeded relationships (no upgrades over two releases are
    supported).
  - Fix Suggests for kvirc-dbg.
  - kvirc-data: Make the "Suggests: kvirc" a Recommends, doesn't make much
    sense to install the -data package without the program.
* debian/source/local-options: Added with "unapply-patches".
* debian/kvirc.lintian-overrides: Updated to work for 4.1.1.
* debian/patches/21_make_shared-mime-info_B-D_superfluous.patch: Updated.
* debian/kvirc-data.install: Added .notifyrc.

[ Raúl Sánchez Siles ]
* Stating the right version where kvirc-data break and replace should happen.
* Fixing link to license file.
* Added French and Portuguese man pages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//=============================================================================
2
 
//
3
 
//   File : kvi_debugwindow.cpp
4
 
//   Creation date : Sun Jul 18 2005 14:12:22 by Szymon Stefanek
5
 
//
6
 
//   This file is part of the KVirc irc client distribution
7
 
//   Copyright (C) 2005-2008 Szymon Stefanek (pragma at kvirc dot net)
8
 
//
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.
13
 
//
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.
18
 
//
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.
22
 
//
23
 
//=============================================================================
24
 
 
25
 
 
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"
34
 
 
35
 
#include "kvi_parameterlist.h"
36
 
#include "kvi_frame.h"
37
 
 
38
 
#include <QList>
39
 
#include <QPixmap>
40
 
 
41
 
KviDebugWindow * KviDebugWindow::m_pInstance = 0;
42
 
 
43
 
 
44
 
KviDebugWindow::KviDebugWindow()
45
 
: KviWindow(KVI_WINDOW_TYPE_DEBUG,g_pFrame,__tr2qs("Debug Messages"),0)
46
 
{
47
 
        m_pInstance = this;
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);
52
 
        updateCaption();
53
 
}
54
 
 
55
 
KviDebugWindow::~KviDebugWindow()
56
 
{
57
 
        m_pInstance = 0;
58
 
}
59
 
 
60
 
KviDebugWindow * KviDebugWindow::getInstance()
61
 
{
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();
67
 
        return m_pInstance;
68
 
}
69
 
 
70
 
void KviDebugWindow::getBaseLogFileName(QString &buffer)
71
 
{
72
 
        buffer = "debug";
73
 
}
74
 
 
75
 
void KviDebugWindow::saveProperties(KviConfig *cfg)
76
 
{
77
 
        KviWindow::saveProperties(cfg);
78
 
        cfg->writeEntry("Splitter",m_pSplitter->sizes());
79
 
}
80
 
 
81
 
void KviDebugWindow::loadProperties(KviConfig *cfg)
82
 
{
83
 
        int w = width();
84
 
        KviWindow::loadProperties(cfg);
85
 
        QList<int> def;
86
 
        def.append((w * 80) / 100);
87
 
        def.append((w * 20) / 100);
88
 
        m_pSplitter->setSizes(cfg->readIntListEntry("Splitter",def));
89
 
}
90
 
 
91
 
void KviDebugWindow::fillCaptionBuffers()
92
 
{
93
 
        m_szPlainTextCaption = windowName();
94
 
}
95
 
 
96
 
QPixmap * KviDebugWindow::myIconPtr()
97
 
{
98
 
        return g_pIconManager->getSmallIcon(KVI_SMALLICON_BUG);
99
 
}
100
 
 
101
 
void KviDebugWindow::resizeEvent(QResizeEvent *)
102
 
{
103
 
        int hght = m_pInput->heightHint();
104
 
        m_pSplitter->setGeometry(0,0,width(),height() - hght);
105
 
        m_pInput->setGeometry(0,height() - hght,width(),hght);
106
 
}
107
 
 
108
 
QSize KviDebugWindow::sizeHint() const
109
 
{
110
 
        QSize ret(m_pSplitter->sizeHint().width(),m_pIrcView->sizeHint().height() + m_pInput->heightHint());
111
 
        return ret;
112
 
}