1 /***************************************************************************
2 knetdialog.cpp - description
5 copyright : (C) 2001 by andres
7 ***************************************************************************/
9 #include "knetdialog.h"
11 #include <kdialogbase.h>
12 #include <klineedit.h>
15 #include <qradiobutton.h>
19 #include <qvbuttongroup.h>
20 #include <qvgroupbox.h>
23 KNetDialog::KNetDialog( QWidget *parent, const char *name ) :
24 KDialogBase( parent, name, true, QString::null, Ok|Cancel, Ok, true )
26 QVBox *pageVBox = makeVBoxMainWidget();
28 QHBox *layout = new QHBox( pageVBox );
29 layout->setSpacing( 5 );
30 fButtonGroup = new QVButtonGroup( "Protocol", layout );
31 fTSButton = new QRadioButton( "TS", fButtonGroup);
32 fTSButton->setChecked( true );
33 fRTPButton = new QRadioButton( "RTP", fButtonGroup);
34 fRTPButton->setEnabled( false );
35 fHTTPButton = new QRadioButton( "HTTP", fButtonGroup);
36 fHTTPButton->setEnabled( false );
38 QVGroupBox *serverVBox = new QVGroupBox( "Starting position", layout );
40 QHBox *titleHBox = new QHBox( serverVBox );
41 QLabel *titleLabel = new QLabel( "Address ", titleHBox );
42 fAddress = new KLineEdit( "vls", titleHBox );
43 QHBox *portHBox = new QHBox( serverVBox );
44 QLabel *portLabel = new QLabel( "Port ", portHBox );
45 fPort = new QSpinBox( 0, 65535, 1, portHBox );
48 KNetDialog::~KNetDialog()
52 QString KNetDialog::protocol() const
54 if ( fTSButton->isChecked() )
56 return ( QString( "ts" ) );
58 else if ( fRTPButton->isChecked() )
60 return ( QString( "rtp" ) );
64 return ( QString( "http" ) );
68 QString KNetDialog::server() const
70 return ( fAddress->text() );
73 int KNetDialog::port() const
75 return ( fPort->value() );