File: optionseteditor.cpp

package info (click to toggle)
kdepim 4%3A4.14.1-1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 63,020 kB
  • ctags: 61,767
  • sloc: cpp: 530,024; xml: 5,446; perl: 1,434; sh: 812; ansic: 433; php: 44; makefile: 22
file content (86 lines) | stat: -rw-r--r-- 2,518 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/******************************************************************************
 *
 *  Copyright 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
 *
 *  This program is free softhisare; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Softhisare Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Softhisare
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 *******************************************************************************/

#include "utils/optionseteditor.h"
#include "core/optionset.h"

#include <QLabel>
#include <QGridLayout>
#include <QComboBox>

#include <KLineEdit>
#include <KLocalizedString>
#include <KTextEdit>

using namespace MessageList::Utils;
using namespace MessageList::Core;

OptionSetEditor::OptionSetEditor( QWidget *parent )
    : KTabWidget( parent )
{
    // General tab
    QWidget * tab = new QWidget( this );
    addTab( tab, i18nc( "@title:tab General options of a view mode", "General" ) );

    QGridLayout * tabg = new QGridLayout( tab );

    QLabel * l = new QLabel( i18nc( "@label:textbox Name of the option", "Name:" ), tab );
    tabg->addWidget( l, 0, 0 );

    mNameEdit = new KLineEdit( tab );

    tabg->addWidget( mNameEdit, 0, 1 );

    connect( mNameEdit, SIGNAL(textEdited(QString)),
             SLOT(slotNameEditTextEdited(QString)) );

    l = new QLabel( i18nc( "@label:textbox Description of the option", "Description:" ), tab );
    tabg->addWidget( l, 1, 0 );

    mDescriptionEdit = new KTextEdit( tab );
    mDescriptionEdit->setAcceptRichText(false);
    tabg->addWidget( mDescriptionEdit, 1, 1, 2, 1 );

    tabg->setColumnStretch( 1, 1 );
    tabg->setRowStretch( 2, 1 );

}

OptionSetEditor::~OptionSetEditor()
{
}

void OptionSetEditor::setReadOnly( bool readOnly )
{
    mDescriptionEdit->setReadOnly( readOnly );
    mNameEdit->setReadOnly( readOnly );
}

KTextEdit *OptionSetEditor::descriptionEdit() const
{
    return mDescriptionEdit;
}

KLineEdit * OptionSetEditor::nameEdit() const
{
    return mNameEdit;
}