summaryrefslogtreecommitdiffstats
path: root/kradio3/plugins/gui-standard-display/radioview-configuration.cpp
blob: 9a223139db40464663f13e059a29604949c744d6 (plain)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/***************************************************************************
                          radioview-configuration.cpp  -  description
                             -------------------
    begin                : Fr Aug 15 2003
    copyright            : (C) 2003 by Martin Witte
    email                : witte@kawo1.rwth-aachen.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "radioview-configuration.h"
 
RadioViewConfiguration::RadioViewConfiguration(QWidget *parent)
	: QTabWidget (parent),
      m_dirty(true)
{
}

RadioViewConfiguration::~RadioViewConfiguration()
{
}


void RadioViewConfiguration::addTab    (QWidget *child, const QString &label)
{
	QTabWidget::addTab(child, label);
	QObject::connect(this,  SIGNAL(sigOK()),     child, SLOT(slotOK()));
	QObject::connect(this,  SIGNAL(sigCancel()), child, SLOT(slotCancel()));
    QObject::connect(child, SIGNAL(sigDirty()),  this,  SLOT(slotSetDirty()));
}


void RadioViewConfiguration::addTab    (QWidget *child, const QIconSet &iconset, const QString &label)
{
	QTabWidget::addTab(child, iconset, label);
	QObject::connect(this,  SIGNAL(sigOK()),     child, SLOT(slotOK()));
	QObject::connect(this,  SIGNAL(sigCancel()), child, SLOT(slotCancel()));
    QObject::connect(child, SIGNAL(sigDirty()),  this,  SLOT(slotSetDirty()));
}


void RadioViewConfiguration::addTab    (QWidget *child, QTab *tab)
{
	QTabWidget::addTab(child, tab);
	QObject::connect(this,  SIGNAL(sigOK()),     child, SLOT(slotOK()));
	QObject::connect(this,  SIGNAL(sigCancel()), child, SLOT(slotCancel()));
    QObject::connect(child, SIGNAL(sigDirty()),  this,  SLOT(slotSetDirty()));
}


void RadioViewConfiguration::insertTab (QWidget *child, const QString &label, int index)
{
	QTabWidget::insertTab(child, label, index);
	QObject::connect(this,  SIGNAL(sigOK()),     child, SLOT(slotOK()));
	QObject::connect(this,  SIGNAL(sigCancel()), child, SLOT(slotCancel()));
    QObject::connect(child, SIGNAL(sigDirty()),  this,  SLOT(slotSetDirty()));
}


void RadioViewConfiguration::insertTab (QWidget *child, const QIconSet &iconset, const QString &label, int index)
{
	QTabWidget::insertTab(child, iconset, label, index);
	QObject::connect(this,  SIGNAL(sigOK()),     child, SLOT(slotOK()));
	QObject::connect(this,  SIGNAL(sigCancel()), child, SLOT(slotCancel()));
    QObject::connect(child, SIGNAL(sigDirty()),  this,  SLOT(slotSetDirty()));
}


void RadioViewConfiguration::insertTab (QWidget *child, QTab *tab, int index)
{
	QTabWidget::insertTab(child, tab, index);
	QObject::connect(this,  SIGNAL(sigOK()),     child, SLOT(slotOK()));
	QObject::connect(this,  SIGNAL(sigCancel()), child, SLOT(slotCancel()));
    QObject::connect(child, SIGNAL(sigDirty()),  this,  SLOT(slotSetDirty()));
}


void RadioViewConfiguration::removePage(QWidget *w)
{
	QObject::disconnect(this,  SIGNAL(sigOK()),     w,    SLOT(slotOK()));
	QObject::disconnect(this,  SIGNAL(sigCancel()), w,    SLOT(slotCancel()));
    QObject::disconnect(w,     SIGNAL(sigDirty()),  this, SLOT(slotSetDirty()));
	QTabWidget::removePage(w);
}


void RadioViewConfiguration::slotOK()
{
    if (m_dirty) {
        emit sigOK();
        m_dirty = false;
    }
}

void RadioViewConfiguration::slotCancel()
{
    if (m_dirty) {
        emit sigCancel();
        m_dirty = false;
    }
}

void RadioViewConfiguration::slotSetDirty()
{
    m_dirty = true;
}


#include "radioview-configuration.moc"