2 ***************************************************************************
4 * 4F, No. 2 Technology 5th Rd.
5 * Science-based Industrial Park
6 * Hsin-chu, Taiwan, R.O.C.
8 * (c) Copyright 2002, Ralink Technology, Inc.
10 * All rights reserved. Ralink's source code is an unpublished work and the
11 * use of a copyright notice does not imply otherwise. This source code
12 * contains confidential trade secret material of Ralink Tech. Any attemp
13 * or participation in deciphering, decoding, reverse engineering or in any
14 * way altering the source code is stricitly prohibited, unless the prior
15 * written consent of Ralink Technology, Inc. is obtained.
16 ***************************************************************************
22 Implement Country Region Select Dialog.
26 -------- ---------- ----------------------------------------------
27 Paul Wu 01-22-2003 created
31 #include "countryform.h"
34 #include <qapplication.h>
36 #include <qbuttongroup.h>
38 #include <qpushbutton.h>
39 #include <qradiobutton.h>
41 #include <qdragobject.h>
44 #include <qwhatsthis.h>
48 static QPixmap
uic_load_pixmap_CountryForm( const QString
&name
)
50 const QMimeSource
*m
= QMimeSourceFactory::defaultFactory()->data( name
);
54 QImageDrag::decode( m
, pix
);
58 * Constructs a CountryForm which is a child of 'parent', with the
59 * name 'name' and widget flags set to 'f'.
61 * The dialog will by default be modeless, unless you set 'modal' to
62 * TRUE to construct a modal dialog.
64 CountryForm::CountryForm( QWidget
* parent
, const char* name
, bool modal
, WFlags fl
)
65 : QDialog( parent
, name
, modal
, fl
)
68 setName( "CountryForm" );
70 setMinimumSize( 530, 227 );
71 setMaximumSize( 530, 227 );
72 qApp
->setStyle("Windows");
74 setCaption("Region Select");
76 InfoTextLabel
= new QLabel( this, "InfoTextLabel" );
77 InfoTextLabel
->setGeometry( QRect( 20, 10, 500, 30 ) );
78 InfoTextLabel
->setText("Please select a country region according to your current region.");
80 OkPushButton
= new QPushButton( this, "OkPushButton" );
81 OkPushButton
->setGeometry( QRect( 160, 190, 80, 22 ) );
82 OkPushButton
->setText("&Ok");
84 CancelPushButton
= new QPushButton( this, "CancelPushButton" );
85 CancelPushButton
->setGeometry( QRect( 290, 190, 80, 22 ) );
86 CancelPushButton
->setText("&Cancel");
88 SelectButtonGroup
= new QButtonGroup( this, "SelectButtonGroup" );
89 SelectButtonGroup
->setGeometry( QRect( 20, 40, 490, 131 ) );
90 SelectButtonGroup
->setTitle("Region Select");
92 ISRAELRadioButton
= new QRadioButton( SelectButtonGroup
, "ISRAELRadioButton" );
93 ISRAELRadioButton
->setGeometry( QRect( 250, 100, 211, 20 ) );
94 ISRAELRadioButton
->setText("ISRAEL (Channel 3 - 9)");
95 SelectButtonGroup
->insert(ISRAELRadioButton
, REGSTR_COUNTRYREGION_ISRAEL
);
97 ICRadioButton
= new QRadioButton( SelectButtonGroup
, "ICRadioButton" );
98 ICRadioButton
->setGeometry( QRect( 20, 50, 191, 21 ) );
99 ICRadioButton
->setText("IC (Canada) (Channel 1 - 11)");
100 SelectButtonGroup
->insert(ICRadioButton
, REGSTR_COUNTRYREGION_IC
);
102 ETSIRadioButton
= new QRadioButton( SelectButtonGroup
, "ETSIRadioButton" );
103 ETSIRadioButton
->setGeometry( QRect( 20, 75, 211, 21 ) );
104 ETSIRadioButton
->setText("ETSI (Channel 1 - 13)");
105 SelectButtonGroup
->insert(ETSIRadioButton
, REGSTR_COUNTRYREGION_ETSI
);
107 MKKRadioButton
= new QRadioButton( SelectButtonGroup
, "MKKRadioButton" );
108 MKKRadioButton
->setGeometry( QRect( 250, 50, 211, 21 ) );
109 MKKRadioButton
->setText("MKK (Channel 14)");
110 SelectButtonGroup
->insert(MKKRadioButton
, REGSTR_COUNTRYREGION_MKK
);
112 MKK1RadioButton
= new QRadioButton( SelectButtonGroup
, "MKK1RadioButton" );
113 MKK1RadioButton
->setGeometry( QRect( 250, 75, 210, 20 ) );
114 MKK1RadioButton
->setText("MKK1 (TELEC) (Channel 1 - 14)");
115 SelectButtonGroup
->insert(MKK1RadioButton
, REGSTR_COUNTRYREGION_MKK1
);
117 FRANCERadioButton
= new QRadioButton( SelectButtonGroup
, "FRANCERadioButton" );
118 FRANCERadioButton
->setGeometry( QRect( 249, 25, 211, 20 ) );
119 FRANCERadioButton
->setText("FRANCE (Channel 10 - 13)");
120 SelectButtonGroup
->insert(FRANCERadioButton
, REGSTR_COUNTRYREGION_FRANCE
);
122 SPAINRadioButton
= new QRadioButton( SelectButtonGroup
, "SPAINRadioButton" );
123 SPAINRadioButton
->setGeometry( QRect( 20, 100, 164, 19 ) );
124 SPAINRadioButton
->setText("SPAIN (Channel 10 - 11)");
125 SelectButtonGroup
->insert(SPAINRadioButton
, REGSTR_COUNTRYREGION_SPAIN
);
127 FCCRadioButton
= new QRadioButton( SelectButtonGroup
, "FCCRadioButton" );
128 FCCRadioButton
->setGeometry( QRect( 20, 25, 201, 21 ) );
129 FCCRadioButton
->setText("FCC (Channel 1 - 11)(Default)");
130 FCCRadioButton
->setChecked( TRUE
);
131 SelectButtonGroup
->insert( FCCRadioButton
, REGSTR_COUNTRYREGION_FCC
);
133 // signals and slots connections
134 connect( CancelPushButton
, SIGNAL( clicked() ), this, SLOT( reject() ) );
135 connect( OkPushButton
, SIGNAL( clicked() ), this, SLOT( accept() ) );
139 * Destroys the object and frees any allocated resources
141 CountryForm::~CountryForm()
143 // no need to delete child widgets, Qt does it all for us
146 int CountryForm::GetRegionID()
148 return (SelectButtonGroup
->id(SelectButtonGroup
->selected()));