~ubuntu-branches/ubuntu/hoary/kvirc/hoary

« back to all changes in this revision

Viewing changes to src/kvirc/options/kvi_options_gui_labels.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Robin Verduijn
  • Date: 2004-12-14 15:32:19 UTC
  • mfrom: (0.2.1 upstream) (1.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20041214153219-fdink3gyp2s20b6g
Tags: 2:2.1.3.1-2
* Change Recommends on xmms to a Suggests.
* Rebuild against KDE 3.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// =============================================================================
 
2
//
 
3
//      --- kvi_options_gui_labels.cpp ---
 
4
//
 
5
//   This file is part of the KVIrc IRC client distribution
 
6
//   Copyright (C) 1999-2000 Szymon Stefanek (stefanek@tin.it)
 
7
//
 
8
//   This program is FREE software. You can redistribute it and/or
 
9
//   modify it under the terms of the GNU General Public License
 
10
//   as published by the Free Software Foundation; either version 2
 
11
//   of the License, or (at your opinion) any later version.
 
12
//
 
13
//   This program is distributed in the HOPE that it will be USEFUL,
 
14
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
16
//   See the GNU General Public License for more details.
 
17
//
 
18
//   You should have received a copy of the GNU General Public License
 
19
//   along with this program. If not, write to the Free Software Foundation,
 
20
//   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
21
//
 
22
// =============================================================================
 
23
 
 
24
#define _KVI_DEBUG_CHECK_RANGE_
 
25
#define _KVI_DEBUG_CLASS_NAME_ "KviOptionsGuiLabels"
 
26
 
 
27
#include <qlayout.h>
 
28
 
 
29
#include "kvi_app.h"
 
30
#include "kvi_colorselector.h"
 
31
#include "kvi_fontselector.h"
 
32
#include "kvi_imageselector.h"
 
33
#include "kvi_locale.h"
 
34
#include "kvi_options_gui_labels.h"
 
35
#include "kvi_options.h"
 
36
 
 
37
/*
 
38
        @quickhelp: KviOptionsGuiLabels
 
39
        @widget: Channel labels GUI options
 
40
*/
 
41
KviOptionsGuiLabels::KviOptionsGuiLabels(QWidget *parent)
 
42
        : KviOptionsWidget(parent, KVI_GENERAL_OPTIONS_WIDGET_ID_GUILABELS)
 
43
{
 
44
        QGridLayout *g = new QGridLayout(this, 6, 1, KVI_GENERAL_OPTIONS_GRIDLAYOUT_BORDER, 1);
 
45
 
 
46
        KviColorSelector *s = new KviColorSelector(this, _i18n_("Background color:"), &(g_pOptions->m_clrLabelsBack));
 
47
        g->addWidget(s, 0, 0);
 
48
        s = new KviColorSelector(this, _i18n_("Active foreground color:"), &(g_pOptions->m_clrLabelsActiveFore));
 
49
        g->addWidget(s, 1, 0);
 
50
        s = new KviColorSelector(this, _i18n_("Inactive foreground color:"), &(g_pOptions->m_clrLabelsInactiveFore));
 
51
        g->addWidget(s, 2, 0);
 
52
        KviFontSelector *f = new KviFontSelector(this, _i18n_("Font:"), &(g_pOptions->m_fntLabels));
 
53
        g->addWidget(f, 3, 0);
 
54
 
 
55
        QFrame *fr = new QFrame(this);
 
56
        fr->setFrameStyle(QFrame::HLine | QFrame::Sunken);
 
57
        g->addWidget(fr, 4, 0);
 
58
 
 
59
        m_pLabelsImageSelector = new KviImageSelector(this,
 
60
                _i18n_("Use background image:"), &(g_pOptions->m_szLabelsBack), g_pOptions->m_pixLabelsBack
 
61
        );
 
62
        g->addWidget(m_pLabelsImageSelector, 5, 0);
 
63
 
 
64
        fr = new QFrame(this);
 
65
        g->addWidget(fr, 6, 0);
 
66
        g->setRowStretch(6, 1);
 
67
}
 
68
 
 
69
KviOptionsGuiLabels::~KviOptionsGuiLabels()
 
70
{
 
71
        // Nothing here
 
72
}
 
73
 
 
74
void KviOptionsGuiLabels::commitChanges()
 
75
{
 
76
        commitColorSelectors();
 
77
        commitFontSelectors();
 
78
        commitImageSelectors();
 
79
        g_pOptions->loadLabelsBackgroundImage(m_pLabelsImageSelector->getImage());
 
80
        g_pApp->triggerGlobalRepaint();
 
81
}
 
82
 
 
83
#include "m_kvi_options_gui_labels.moc"