summaryrefslogtreecommitdiffstats
path: root/kbugbuster/gui/severityselectdialog.cpp
blob: 66eac388e759bb21053c58fe7262f361ede8b9bb (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
#include <layout.h>
#include <tqbuttongroup.h>
#include <tqradiobutton.h>

#include <kdebug.h>

#include "bugsystem.h"
#include "kbbprefs.h"

#include "severityselectdialog.h"
#include "severityselectdialog.moc"

SeveritySelectDialog::SeveritySelectDialog(TQWidget *parent,const char *name) :
  KDialogBase( parent, name, true, i18n("Select Severity"), Ok|Cancel )
{
    mButtonGroup = new TQButtonGroup( 1,Qt::Horizontal, i18n("Severity"), this );
    setMainWidget( mButtonGroup );

    TQValueList<Bug::Severity> severities = Bug::severities();
    TQValueList<Bug::Severity>::ConstIterator it;
    for( it = severities.begin(); it != severities.end(); ++it ) {
        mButtonGroup->insert(
            new TQRadioButton( Bug::severityToString( *it ), mButtonGroup ), int(*it) );
    }
}

void SeveritySelectDialog::setSeverity( Bug::Severity s )
{
    mButtonGroup->setButton( s );
}

Bug::Severity SeveritySelectDialog::selectedSeverity()
{
    return (Bug::Severity)mButtonGroup->id( mButtonGroup->selected() );
}

TQString SeveritySelectDialog::selectedSeverityAsString()
{
    return Bug::severityToString( selectedSeverity() );
}