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

« back to all changes in this revision

Viewing changes to src/modules/options/optw_input.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 : optw_input.cpp
4
 
//   Creation date : Sat Aug 11 2001 04:25:52 CEST by Szymon Stefanek
5
 
//
6
 
//   This file is part of the KVirc irc client distribution
7
 
//   Copyright (C) 2001-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
 
#include "optw_input.h"
26
 
 
27
 
#include "kvi_options.h"
28
 
#include "kvi_locale.h"
29
 
 
30
 
#include <QLayout>
31
 
 
32
 
KviInputLookOptionsWidget::KviInputLookOptionsWidget(QWidget * parent)
33
 
: KviOptionsWidget(parent)
34
 
{
35
 
        setObjectName("inputlook_options_widget");
36
 
        createLayout();
37
 
 
38
 
        addFontSelector(0,0,1,0,__tr2qs_ctx("Font","options"),KviOption_fontInput);
39
 
        addColorSelector(0,1,1,1,__tr2qs_ctx("Background color","options"),KviOption_colorInputBackground);
40
 
        addColorSelector(0,2,1,2,__tr2qs_ctx("Foreground color","options"),KviOption_colorInputForeground);
41
 
        addColorSelector(0,3,1,3,__tr2qs_ctx("Selection background color","options"),KviOption_colorInputSelectionBackground);
42
 
        addColorSelector(0,4,1,4,__tr2qs_ctx("Selection foreground color","options"),KviOption_colorInputSelectionForeground);
43
 
        addColorSelector(0,5,1,5,__tr2qs_ctx("Control char color","options"),KviOption_colorInputControl);
44
 
        addColorSelector(0,6,1,6,__tr2qs_ctx("Cursor color","options"),KviOption_colorInputCursor);
45
 
 
46
 
        addPixmapSelector(0,7,1,7,__tr2qs_ctx("Background image","options"),KviOption_pixmapInputBackground);
47
 
 
48
 
        addLabel(0,8,0,8,__tr2qs_ctx("Horizontal align:","options"));
49
 
        m_pHorizontalAlign=new QComboBox(this);
50
 
        addWidgetToLayout(m_pHorizontalAlign,1,8,1,8);
51
 
 
52
 
        addLabel(0,9,0,9,__tr2qs_ctx("Vertical align:","options"));
53
 
        m_pVerticalAlign=new QComboBox(this);
54
 
        addWidgetToLayout(m_pVerticalAlign,1,9,1,9);
55
 
 
56
 
        m_pHorizontalAlign->addItem(__tr2qs_ctx("Tile","options"));
57
 
        m_pHorizontalAlign->addItem(__tr2qs_ctx("Left","options"));
58
 
        m_pHorizontalAlign->addItem(__tr2qs_ctx("Right","options"));
59
 
        m_pHorizontalAlign->addItem(__tr2qs_ctx("Center","options"));
60
 
 
61
 
        m_pVerticalAlign->addItem(__tr2qs_ctx("Tile","options"));
62
 
        m_pVerticalAlign->addItem(__tr2qs_ctx("Top","options"));
63
 
        m_pVerticalAlign->addItem(__tr2qs_ctx("Bottom","options"));
64
 
        m_pVerticalAlign->addItem(__tr2qs_ctx("Center","options"));
65
 
 
66
 
        switch( KVI_OPTION_UINT(KviOption_uintInputPixmapAlign) & Qt::AlignHorizontal_Mask)
67
 
        {
68
 
                case Qt::AlignLeft:
69
 
                        m_pHorizontalAlign->setCurrentIndex(1);
70
 
                        break;
71
 
                case Qt::AlignRight:
72
 
                        m_pHorizontalAlign->setCurrentIndex(2);
73
 
                        break;
74
 
                case Qt::AlignHCenter:
75
 
                        m_pHorizontalAlign->setCurrentIndex(3);
76
 
                        break;
77
 
                default:
78
 
                        m_pHorizontalAlign->setCurrentIndex(0);
79
 
        }
80
 
 
81
 
        switch( KVI_OPTION_UINT(KviOption_uintInputPixmapAlign) & Qt::AlignVertical_Mask)
82
 
        {
83
 
                case Qt::AlignTop:
84
 
                        m_pVerticalAlign->setCurrentIndex(1);
85
 
                        break;
86
 
                case Qt::AlignBottom:
87
 
                        m_pVerticalAlign->setCurrentIndex(2);
88
 
                        break;
89
 
                case Qt::AlignVCenter:
90
 
                        m_pVerticalAlign->setCurrentIndex(3);
91
 
                        break;
92
 
                default:
93
 
                        m_pVerticalAlign->setCurrentIndex(0);
94
 
        }
95
 
 
96
 
 
97
 
        layout()->setRowStretch(7,1);
98
 
}
99
 
 
100
 
KviInputLookOptionsWidget::~KviInputLookOptionsWidget()
101
 
{
102
 
}
103
 
 
104
 
void KviInputLookOptionsWidget::commit()
105
 
{
106
 
        int iFlags=0;
107
 
        switch(m_pHorizontalAlign->currentIndex())
108
 
        {
109
 
                case 1:
110
 
                        iFlags|=Qt::AlignLeft;
111
 
                        break;
112
 
                case 2:
113
 
                        iFlags|=Qt::AlignRight;
114
 
                        break;
115
 
                case 3:
116
 
                        iFlags|=Qt::AlignHCenter;
117
 
                        break;
118
 
        }
119
 
        switch(m_pVerticalAlign->currentIndex())
120
 
        {
121
 
                case 1:
122
 
                        iFlags|=Qt::AlignTop;
123
 
                        break;
124
 
                case 2:
125
 
                        iFlags|=Qt::AlignBottom;
126
 
                        break;
127
 
                case 3:
128
 
                        iFlags|=Qt::AlignVCenter;
129
 
                        break;
130
 
        }
131
 
 
132
 
        KVI_OPTION_UINT(KviOption_uintInputPixmapAlign)=iFlags;
133
 
        KviOptionsWidget::commit();
134
 
}
135
 
 
136
 
 
137
 
KviInputFeaturesOptionsWidget::KviInputFeaturesOptionsWidget(QWidget * parent)
138
 
: KviOptionsWidget(parent)
139
 
{
140
 
        setObjectName("ircviewfeatures_options_widget");
141
 
        createLayout();
142
 
 
143
 
        addBoolSelector(0,0,0,0,__tr2qs_ctx("Warp cursor at the end of line when browsing history","options"),KviOption_boolInputHistoryCursorAtEnd);
144
 
        addBoolSelector(0,1,0,1,__tr2qs_ctx("Enable the input history logging","options"),KviOption_boolEnableInputHistory); //G&N 2005
145
 
        addBoolSelector(0,2,0,2,__tr2qs_ctx("Hide input toolbuttons by default","options"),KviOption_boolHideInputToolButtons);
146
 
        addBoolSelector(0,3,0,3,__tr2qs_ctx("Commandline in user-friendly mode by default","options"),KviOption_boolCommandlineInUserFriendlyModeByDefault);
147
 
        addUIntSelector(0,4,0,4,__tr2qs_ctx("Expand tabulations in input using this amount of spaces:","options"),KviOption_uintSpacesToExpandTabulationInput,1,24,8,true);
148
 
 
149
 
        KviTalGroupBox * g = addGroupBox(0,5,0,5,Qt::Horizontal,__tr2qs_ctx("Nick completion","options"));
150
 
        KviBoolSelector * b, *c;
151
 
        b = addBoolSelector(g,__tr2qs_ctx("Use bash-like nick completion","options"),KviOption_boolBashLikeNickCompletion,!KVI_OPTION_BOOL(KviOption_boolZshLikeNickCompletion));
152
 
        c = addBoolSelector(g,__tr2qs_ctx("Use zsh-like nick completion","options"),KviOption_boolZshLikeNickCompletion,!KVI_OPTION_BOOL(KviOption_boolBashLikeNickCompletion));
153
 
        connect(b,SIGNAL(toggled(bool)),c,SLOT(setDisabled(bool)));
154
 
        connect(c,SIGNAL(toggled(bool)),b,SLOT(setDisabled(bool)));
155
 
 
156
 
        addStringSelector(g,__tr2qs_ctx("Nick completion postfix string","options"),KviOption_stringNickCompletionPostfix);
157
 
        addBoolSelector(g,__tr2qs_ctx("Use the completion postfix string for the first word only","options"),KviOption_boolUseNickCompletionPostfixForFirstWordOnly);
158
 
        addRowSpacer(0,6,0,6);
159
 
}
160
 
 
161
 
KviInputFeaturesOptionsWidget::~KviInputFeaturesOptionsWidget()
162
 
{
163
 
}
164
 
 
165
 
#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES
166
 
#include "m_optw_input.moc"
167
 
#endif //!COMPILE_USE_STANDALONE_MOC_SOURCES