Codebase list httraqt / d9b8c29
optionslimits editable comboboxes Eduard Kalinowski 10 years ago
11 changed file(s) with 428 addition(s) and 145 deletion(s). Raw diff Collapse all Expand all
928928 Previous
929929 Назад
930930 Next
931 Вперед
931 Далее
932932 URLs
933933 URLs
934934 Warning
222222 }
223223
224224 if (msgBox == NULL) {
225 // qDebug() << "not found dialog" << ticon;
225 // qDebug() << "not found dialog" << ticon;
226226 return 0;
227227 }
228228
11681168 profile_code(v);
11691169 // qDebug() << "save" << v;
11701170 s->setValue((*iopt).name, v);
1171 } else {
1171 }
1172
1173 if ((*iopt).type == FLOAT) {
1174 if ((*iopt).value.toFloat() != -1) {
1175 float fTmp = (*iopt).value.toFloat();
1176 QString fTxt;
1177 fTxt = QString().sprintf("%4.2f", fTmp);
1178 s->setValue((*iopt).name, (LLint)( fTxt.toFloat() * 1024 * 1024));
1179 } else {
1180 s->setValue((*iopt).name, "");
1181 }
1182 }
1183
1184 if ((*iopt).type == INTEGER) {
11721185 if ((*iopt).value.toInt() != -1) {
11731186 s->setValue((*iopt).name, (*iopt).value.toInt());
11741187 } else {
12001213 profile_decode(tStr);
12011214 // qDebug() << "load" << tStr;
12021215 (*iopt).value = tStr;
1216
1217 continue;
1218 }
1219
1220 if ((*iopt).type == FLOAT) {
1221 bool iOk;
1222 tFloat = s->value((*iopt).name, (*iopt).value).toFloat(&iOk);
1223
1224 if (iOk == true) {
1225 (*iopt).value = (tFloat / (1024.0 * 1024.0)); // overwrite the default value if right
1226 }
12031227
12041228 continue;
12051229 }
14291453 "CurrentAction", INTEGER, 0
14301454 };
14311455 prOptions << (options) {
1432 "MaxHtml", INTEGER, 0
1433 };
1434 prOptions << (options) {
1435 "MaxOther", INTEGER, 0
1436 };
1437 prOptions << (options) {
1438 "MaxAll", INTEGER, 0
1456 "MaxHtml", FLOAT, -1
1457 };
1458 prOptions << (options) {
1459 "MaxOther", FLOAT, -1
1460 };
1461 prOptions << (options) {
1462 "MaxAll", FLOAT, -1
14391463 };
14401464 prOptions << (options) {
14411465 "MaxWait", INTEGER, 0
14441468 "MaxTime", INTEGER, -1
14451469 };
14461470 prOptions << (options) {
1447 "MaxRate", INTEGER, -1
1471 "MaxRate", FLOAT, -1
14481472 };
14491473 prOptions << (options) {
14501474 "MaxConn", INTEGER, -1
29773001 }
29783002
29793003
3004 void HTTraQt::SetProfile(QString variName, float val)
3005 {
3006 QVector<options>::iterator iopt;
3007
3008 if (variName.length() < 1) {
3009 return;
3010 }
3011
3012 for (iopt = prOptions.begin(); iopt != prOptions.end(); ++iopt) {
3013 if ((*iopt).name == variName) {
3014 if ((*iopt).type != FLOAT) {
3015 qDebug() << "Wrong type!" << (*iopt).name;
3016 break;
3017 }
3018
3019 (*iopt).value = val;
3020 break;
3021 }
3022 }
3023 }
3024
3025
29803026 void HTTraQt::SetProfile(QString variName, int val)
29813027 {
29823028 QVector<options>::iterator iopt;
30153061 }
30163062
30173063 (*iopt).value = val;
3064 break;
3065 }
3066 }
3067 }
3068
3069
3070 void HTTraQt::GetProfile(QString variName, float &val)
3071 {
3072 QVector<options>::iterator iopt;
3073
3074 if (variName.length() < 1) {
3075 return;
3076 }
3077
3078 for (iopt = prOptions.begin(); iopt != prOptions.end(); ++iopt) {
3079 if ((*iopt).name == variName) {
3080 if ((*iopt).type != FLOAT) {
3081 qDebug() << "Wrong type!" << (*iopt).name;
3082 break;
3083 }
3084
3085 val = (*iopt).value.toFloat();
30183086 break;
30193087 }
30203088 }
32143282 }
32153283
32163284 // maxfile_nonhtml
3217 GetProfile("MaxOther", n);
3218
3219 if (n != 0) {
3220 opt->maxfile_nonhtml = (LLint)n * 1024 * 1024;
3285 GetProfile("MaxOther", nf);
3286
3287 if (nf != 0) {
3288 opt->maxfile_nonhtml = (LLint)(nf * 1024 * 1024);
32213289 } else {
32223290 opt->maxfile_nonhtml = -1;
32233291 }
32243292
32253293 // maxfile_html
3226 GetProfile("MaxHtml", n);
3227
3228 if (n != 0) {
3229 opt->maxfile_html = (LLint)n * 1024 * 1024;
3294 GetProfile("MaxHtml", nf);
3295
3296 if (nf != 0) {
3297 opt->maxfile_html = (LLint)nf * 1024 * 1024;
32303298 } else {
32313299 opt->maxfile_html = -1;
32323300 }
32333301
32343302 // maxsite
3235 GetProfile("MaxAll", n);
3236
3237 if (n != 0) {
3238 opt->maxsite = (LLint)n * 1024 * 1024;
3303 GetProfile("MaxAll", nf);
3304
3305 if (nf != 0) {
3306 opt->maxsite = (LLint)(nf * 1024 * 1024);
32393307 } else {
32403308 opt->maxsite = -1;
32413309 }
32773345 }
32783346
32793347 // maxrate
3280 GetProfile("MaxRate", n);
3281
3282 if (n >= 0) {
3283 opt->maxrate = n * 1024 * 1024;
3348 GetProfile("MaxRate", nf);
3349
3350 if (nf >= 0) {
3351 opt->maxrate = (int)(nf * 1024 * 1024);
32843352 } else {
32853353 opt->maxrate = -1;
32863354 }
33473415 {
33483416 QString st;
33493417 int n;
3418 float nf;
33503419 int n1;
33513420 char choixdeb;
33523421 int action;
36623731 cmdOpt += filter;
36633732
36643733 //sizemax
3665 GetProfile("MaxAll", n);
3734 GetProfile("MaxAll", nf);
36663735
36673736 if (n > 0) {
3668 cmdOpt += ("-M" + QString::number(n * 1024 * 1024) + " ");
3737 cmdOpt += ("-M" + QString::number((LLint)(nf * 1024 * 1024)) + " ");
36693738 }
36703739
36713740 //pausebytes
36753744 cmdOpt += ("-G" + QString::number(n) + " ");
36763745 }
36773746
3678 GetProfile("MaxHtml", n);
3679 GetProfile("MaxOther", n1);
3680
3681 if (n >= 0 || n1 >= 0) {
3747 float nf1;
3748 GetProfile("MaxHtml", nf);
3749 GetProfile("MaxOther", nf1);
3750
3751 if (nf >= 0 || nf1 >= 0) {
36823752 cmdOpt += "-m";
36833753
3684 if (n1 > 0) {
3685 cmdOpt += QString::number(n * 1024 * 1024);
3754 if (nf1 > 0) {
3755 cmdOpt += QString::number((LLint)(nf1 * 1024 * 1024));
36863756 } else {
36873757 cmdOpt += "0";
36883758 }
36893759
3690 if (n > 0) {
3691 cmdOpt += ("," + QString::number(n * 1024 * 1024));
3760 if (nf > 0) {
3761 cmdOpt += ("," + QString::number((LLint)(nf * 1024 * 1024)));
36923762 } else {
36933763 cmdOpt += ",0";
36943764 }
37703840 cmdOpt += ("-E" + QString::number(n) + " "); // max timeout
37713841 }
37723842
3773 GetProfile("MaxRate", n);
3774
3775 if (n >= 0) {
3776 cmdOpt += ("-A" + QString::number(n * 1024 * 1024) + " "); // max rate
3843 GetProfile("MaxRate", nf);
3844
3845 if (nf >= 0) {
3846 cmdOpt += ("-A" + QString::number((int)(nf * 1024 * 1024)) + " "); // max rate
37773847 }
37783848
37793849 // maxConnections = 0;
156156 void writeSettings(bool global);
157157 void writeGUISettings(void);
158158
159 void SetProfile(QString variName, float val);
159160 void SetProfile(QString variName, int val);
160161 void SetProfile(QString variName, const QString &val);
161162
162163 void GetProfile(QString variName, int &val);
164 void GetProfile(QString variName, float &val);
163165 void GetProfile(QString variName, QString &val);
164166 void clearStatsBuffer(void);
165167 void setFontForWidgets(void);
423423 "Use this capture tool for links that can only be accessed through forms or javascript code", // 412
424424 "Choose language according to preference", // 413
425425 "Catch URL!", // 414
426 "Please set temporary browser proxy settings to the following values (Copy/Paste Proxy Address and Port).\n"
426 "Please set temporary browser proxy settings to the following values (Copy/Paste Proxy Address and Port).\n"
427427 "Then click on the Form SUBMIT button in your browser page, or click on the specific link you want to capture.", // 415
428428 "This will send the desired link from your browser to HTTraQt.", // 416
429429 "Abort", // 417
2323 #include "../main/includes/httraqt.h"
2424 #include "includes/OptionsDialog.h"
2525
26
26
2727 OptionsDialog::OptionsDialog(QWidget* parent, Qt::WFlags fl)
2828 : QDialog(parent, fl)
2929 {
3030 setupUi(this);
3131
3232 this->parent = (HTTraQt*)parent;
33 // qDebug() << "init OptionsDialog";
33 // qDebug() << "init OptionsDialog";
3434 _tabTextInfos.clear();
3535
3636 QToolButton* b[] = {buttonLinks, buttonBuild, buttonRulez, buttonLimits, buttonProxy,
37 buttonExperts, buttonMime, buttonFlow, buttonSpider, buttonBrowser, buttonLog};
38 memcpy(buttons, b, OPTION_SITES*sizeof(QToolButton*));
39
40 int h[] = {_LINKS, _BUILD, _SCANRULEZ, _LIMITS, _PROXY, _EXPERTS, _MIMETYPES, _FLOWCONTROL,
41 _SPIDER, _BROWSERID, _LOGINDEX};
42 memcpy(headers, h, OPTION_SITES*sizeof(int));
43
37 buttonExperts, buttonMime, buttonFlow, buttonSpider, buttonBrowser, buttonLog
38 };
39 memcpy(buttons, b, OPTION_SITES * sizeof(QToolButton*));
40
41 int h[] = {_LINKS, _BUILD, _SCANRULEZ, _LIMITS, _PROXY, _EXPERTS, _MIMETYPES, _FLOWCONTROL,
42 _SPIDER, _BROWSERID, _LOGINDEX
43 };
44 memcpy(headers, h, OPTION_SITES * sizeof(int));
45
4446 for (int i = 0; i < OPTION_SITES; i++) {
4547 // headers[i] = buttons[i]->text();
4648 buttons[i]->setText(translateString(headers[i]));
9597 }
9698
9799 QWidget* p[] = {pLinks, pBuild, pRulez, pLimits, pProxy, pExperts, pMime, pFlow, pSpider, pBrowser, pLog};
98 memcpy(pages, p, OPTION_SITES*sizeof(QWidget*));
100 memcpy(pages, p, OPTION_SITES * sizeof(QWidget*));
99101
100102 buttons[0]->setChecked(true);
101103 }
187189
188190 case EDITLINE: {
189191 if ((*ivec).opttype == INTEGER) {
190 (*ivec).value = ((QLineEdit*)(*ivec).wg)->text().toInt();
192 if (((QLineEdit*)(*ivec).wg)->text() != "-1") {
193 (*ivec).value = ((QLineEdit*)(*ivec).wg)->text().toInt();
194 }
195 } else {
196 (*ivec).value = -1;
197 }
198
199 if ((*ivec).opttype == FLOAT) {
200 if (((QLineEdit*)(*ivec).wg)->text() != "-1") {
201 (*ivec).value = ((QLineEdit*)(*ivec).wg)->text().toFloat();
202 } else {
203 (*ivec).value = -1;
204 }
191205 }
192206
193207 if ((*ivec).opttype == TEXT) {
226240 (*ivec).value = ((QComboBox*)(*ivec).wg)->currentText();
227241 }
228242
229 if ((*ivec).opttype == INTEGER) {
243 if ((*ivec).opttype == INTEGER || (*ivec).opttype == FLOAT) {
230244 bool ok;
231245 QString ct = ((QComboBox*)(*ivec).wg)->currentText();
232246
233247 if (ct == "" || ct == "-") {
234248 (*ivec).value = -1;
235249 } else {
236 int num = ct.toInt(&ok);
237
238 if (ok == true) {
239 (*ivec).value = num;
250 if ((*ivec).opttype == INTEGER ) {
251 int num = ct.toInt(&ok);
252
253 if (ok == true) {
254 (*ivec).value = num;
255 } else {
256 (*ivec).value = ((QComboBox*)(*ivec).wg)->currentIndex();
257 }
240258 } else {
241 (*ivec).value = ((QComboBox*)(*ivec).wg)->currentIndex();
259 float num = ct.toFloat(&ok);
260
261 if (ok == true) {
262 (*ivec).value = num;
263 } else {
264 (*ivec).value = ((QComboBox*)(*ivec).wg)->currentIndex();
265 }
242266 }
243267 }
244268 }
349373 }
350374 }
351375 }
376
377 if ((*ivec).opttype == FLOAT) {
378 int pos ;
379
380 if ((*ivec).value == -1) {
381 pos = ((QComboBox*)(*ivec).wg)->findText("");
382 ((QComboBox*)(*ivec).wg)->setCurrentIndex(pos);
383 } else {
384 pos = ((QComboBox*)(*ivec).wg)->findText(QString::number((*ivec).value.toFloat()));
385
386 if (pos >= 0) {
387 ((QComboBox*)(*ivec).wg)->setCurrentIndex(pos);
388 } else {
389 ((QComboBox*)(*ivec).wg)->setCurrentIndex((*ivec).value.toFloat());
390 }
391 }
392 }
352393 }
353394
354395 break;
360401 }
361402
362403 case EDITLINE: {// no translate for edit widget
363
364404 if ((*ivec).opttype == INTEGER) {
365 ((QLineEdit*)(*ivec).wg)->setText(QString::number((*ivec).value.toInt()));
405 if ((*ivec).value.toInt() == -1) {
406 ((QLineEdit*)(*ivec).wg)->setText("");
407 } else {
408 ((QLineEdit*)(*ivec).wg)->setText(QString::number((*ivec).value.toInt()));
409 }
410 }
411
412 if ((*ivec).opttype == FLOAT) {
413 if ((*ivec).value.toInt() == -1) {
414 ((QLineEdit*)(*ivec).wg)->setText("");
415 } else {
416 ((QLineEdit*)(*ivec).wg)->setText(QString::number((*ivec).value.toFloat()));
417 }
366418 }
367419
368420 if ((*ivec).opttype == TEXT) {
100100 <widget class="QComboBox" name="comboMaxExtDep">
101101 <property name="minimumSize">
102102 <size>
103 <width>75</width>
104 <height>0</height>
105 </size>
106 </property>
107 <property name="maximumSize">
108 <size>
109 <width>100</width>
103 <width>100</width>
104 <height>0</height>
105 </size>
106 </property>
107 <property name="maximumSize">
108 <size>
109 <width>125</width>
110110 <height>25</height>
111111 </size>
112 </property>
113 <property name="editable">
114 <bool>true</bool>
112115 </property>
113116 </widget>
114117 </item>
141144 <widget class="QComboBox" name="comboMaxTime">
142145 <property name="minimumSize">
143146 <size>
144 <width>75</width>
145 <height>0</height>
146 </size>
147 </property>
148 <property name="maximumSize">
149 <size>
150 <width>100</width>
147 <width>100</width>
148 <height>0</height>
149 </size>
150 </property>
151 <property name="maximumSize">
152 <size>
153 <width>125</width>
151154 <height>25</height>
152155 </size>
156 </property>
157 <property name="editable">
158 <bool>true</bool>
153159 </property>
154160 </widget>
155161 </item>
157163 <widget class="QComboBox" name="comboMaxTransf">
158164 <property name="minimumSize">
159165 <size>
160 <width>75</width>
161 <height>0</height>
162 </size>
163 </property>
164 <property name="maximumSize">
165 <size>
166 <width>100</width>
166 <width>100</width>
167 <height>0</height>
168 </size>
169 </property>
170 <property name="maximumSize">
171 <size>
172 <width>125</width>
167173 <height>25</height>
168174 </size>
175 </property>
176 <property name="editable">
177 <bool>true</bool>
169178 </property>
170179 </widget>
171180 </item>
173182 <widget class="QLineEdit" name="editMaxNHtml">
174183 <property name="minimumSize">
175184 <size>
176 <width>75</width>
177 <height>0</height>
178 </size>
179 </property>
180 <property name="maximumSize">
181 <size>
182 <width>100</width>
185 <width>100</width>
186 <height>0</height>
187 </size>
188 </property>
189 <property name="maximumSize">
190 <size>
191 <width>125</width>
183192 <height>16777215</height>
184193 </size>
185194 </property>
189198 <widget class="QLineEdit" name="editPause">
190199 <property name="minimumSize">
191200 <size>
192 <width>75</width>
193 <height>0</height>
194 </size>
195 </property>
196 <property name="maximumSize">
197 <size>
198 <width>100</width>
201 <width>100</width>
202 <height>0</height>
203 </size>
204 </property>
205 <property name="maximumSize">
206 <size>
207 <width>125</width>
199208 <height>16777215</height>
200209 </size>
201210 </property>
268277 <widget class="QComboBox" name="comboMaxLinks">
269278 <property name="minimumSize">
270279 <size>
271 <width>75</width>
272 <height>0</height>
273 </size>
274 </property>
275 <property name="maximumSize">
276 <size>
277 <width>100</width>
280 <width>100</width>
281 <height>0</height>
282 </size>
283 </property>
284 <property name="maximumSize">
285 <size>
286 <width>125</width>
278287 <height>25</height>
279288 </size>
289 </property>
290 <property name="editable">
291 <bool>true</bool>
280292 </property>
281293 </widget>
282294 </item>
398410 <widget class="QLineEdit" name="editMaxHtml">
399411 <property name="minimumSize">
400412 <size>
401 <width>75</width>
402 <height>0</height>
403 </size>
404 </property>
405 <property name="maximumSize">
406 <size>
407 <width>100</width>
413 <width>100</width>
414 <height>0</height>
415 </size>
416 </property>
417 <property name="maximumSize">
418 <size>
419 <width>125</width>
408420 <height>16777215</height>
409421 </size>
410422 </property>
464476 <widget class="QComboBox" name="comboMaxConn">
465477 <property name="minimumSize">
466478 <size>
467 <width>75</width>
468 <height>0</height>
469 </size>
470 </property>
471 <property name="maximumSize">
472 <size>
473 <width>100</width>
479 <width>100</width>
480 <height>0</height>
481 </size>
482 </property>
483 <property name="maximumSize">
484 <size>
485 <width>125</width>
474486 <height>25</height>
475487 </size>
488 </property>
489 <property name="editable">
490 <bool>true</bool>
476491 </property>
477492 </widget>
478493 </item>
530545 <widget class="QLineEdit" name="editMaxSize">
531546 <property name="minimumSize">
532547 <size>
533 <width>75</width>
534 <height>0</height>
535 </size>
536 </property>
537 <property name="maximumSize">
538 <size>
539 <width>100</width>
548 <width>100</width>
549 <height>0</height>
550 </size>
551 </property>
552 <property name="maximumSize">
553 <size>
554 <width>125</width>
540555 <height>16777215</height>
541556 </size>
542557 </property>
571586 <widget class="QComboBox" name="comboMaxDep">
572587 <property name="minimumSize">
573588 <size>
574 <width>75</width>
575 <height>0</height>
576 </size>
577 </property>
578 <property name="maximumSize">
579 <size>
580 <width>100</width>
589 <width>100</width>
590 <height>0</height>
591 </size>
592 </property>
593 <property name="maximumSize">
594 <size>
595 <width>125</width>
581596 <height>25</height>
582597 </size>
598 </property>
599 <property name="editable">
600 <bool>true</bool>
583601 </property>
584602 </widget>
585603 </item>
9494 public:
9595 OptionsDialog(QWidget * parent = 0, Qt::WFlags f = 0);
9696 ~OptionsDialog();
97
97
9898 void onSetDefOptions();
9999 void setToGUI();
100100 void getFromGUI();
5050
5151 protected slots:
5252 /*$PROTECTED_SLOTS$*/
53 void editingFinished(void);
5354 // void unitChanged(bool on);
5455 private:
5556 QVector<trWidgets>* opts;
3333 maxTime << "" << "120" << "900" << "1800" << "3600" << "7200";
3434 limitsForm::comboMaxTime->insertItems(0, maxTime); // max time overall
3535
36 connect (limitsForm::comboMaxTime->lineEdit(), SIGNAL(editingFinished()), this, SLOT(editingFinished()));
37 // connect (limitsForm::comboMaxTime->lineEdit(), SIGNAL(returnPressed()), this, SLOT(editingFinished()));
38
3639 QStringList connSec;
3740 connSec << "" << "1" << "2" << "4" << "8" << "16" << "32" << "64" << "128";
3841 limitsForm::comboMaxConn->insertItems(0, connSec); // max connections/sec
3942
43 connect (limitsForm::comboMaxConn->lineEdit(), SIGNAL(editingFinished()), this, SLOT(editingFinished()));
44 // connect (limitsForm::comboMaxConn->lineEdit(), SIGNAL(returnPressed()), this, SLOT(editingFinished()));
45
4046 limitsForm::comboMaxDep->insertItems(0, connSec); // max depth
47
48 connect (limitsForm::comboMaxDep->lineEdit(), SIGNAL(editingFinished()), this, SLOT(editingFinished()));
49 // connect (limitsForm::comboMaxDep->lineEdit(), SIGNAL(returnPressed()), this, SLOT(editingFinished()));
4150
4251 QStringList extD;
4352 extD << "" << "0" << "1" << "2" << "4" << "8" << "16" << "32" << "64" << "128";
4453 limitsForm::comboMaxExtDep->insertItems(0, extD); // max links
54 connect (limitsForm::comboMaxExtDep->lineEdit(), SIGNAL(editingFinished()), this, SLOT(editingFinished()));
55 // connect (limitsForm::comboMaxExtDep->lineEdit(), SIGNAL(returnPressed()), this, SLOT(editingFinished()));
4556
4657 QStringList maxLinks;
4758 maxLinks << "" << "100000" << "200000" << "1000000" << "5000000";
4859 limitsForm::comboMaxLinks->insertItems(0, maxLinks); // max links
4960
61 connect (limitsForm::comboMaxLinks->lineEdit(), SIGNAL(editingFinished()), this, SLOT(editingFinished()));
62 // connect (limitsForm::comboMaxLinks->lineEdit(), SIGNAL(returnPressed()), this, SLOT(editingFinished()));
63
5064 QStringList maxTransferRate;
51 maxTransferRate << "" << "1" << "5" << "20" << "50" << "75" << "100" << "250";
65 maxTransferRate << "" << "0.01" << "0.1" << "0.5" << "1" << "5" << "20" << "50" << "75" << "100" << "250";
5266 limitsForm::comboMaxTransf->insertItems(0, maxTransferRate); // max transfer rate
67
68 connect (limitsForm::comboMaxTransf->lineEdit(), SIGNAL(editingFinished()), this, SLOT(editingFinished()));
69 // connect (limitsForm::comboMaxTransf->lineEdit(), SIGNAL(returnPressed()), this, SLOT(editingFinished()));
5370
5471 opts = &((OptionsDialog*)(parentDialog))->_tabTextInfos;
5572
110127 }
111128 #endif
112129
130 // check the entered value depended from combobox
131 void optionsLimits::editingFinished()
132 {
133 QLineEdit* from;
134 bool valGood;
135 QString t;
136 from = (QLineEdit*)sender();
137 t = from->text();
138 // qDebug() << from << t;
139 if (t == "" || t == "\n") {
140 limitsForm::comboMaxConn->setCurrentIndex(0); // first element, = -1
141 return;
142 }
143
144 if (from == limitsForm::comboMaxConn->lineEdit()){ // int, range: space, 0..255
145 int tmp = t.toInt(&valGood);
146 if (valGood == true){
147 if (!(tmp >= 0 && tmp <=255)){
148
149 }
150 else{
151 int currInd = limitsForm::comboMaxConn->findText(t);
152 if ( currInd < 0){
153 limitsForm::comboMaxConn->addItem(t);
154 limitsForm::comboMaxConn->model()->sort(0);
155 }
156 else{
157 limitsForm::comboMaxConn->setCurrentIndex(currInd);
158 }
159 }
160 }
161 }
162 if (from == limitsForm::comboMaxDep->lineEdit()){ // int, range: space, 0..9999
163 int tmp = t.toInt(&valGood);
164 if (valGood == true){
165 if (!(tmp >= 0 && tmp <=9999)){
166
167 }
168 else{
169 int currInd = limitsForm::comboMaxConn->findText(t);
170 if ( currInd < 0){
171 limitsForm::comboMaxConn->addItem(t);
172 limitsForm::comboMaxConn->model()->sort(0);
173 }
174 else{
175 limitsForm::comboMaxConn->setCurrentIndex(currInd);
176 }
177 }
178 }
179 }
180 if (from == limitsForm::comboMaxExtDep->lineEdit()){ // int, range: space, 0..9999
181 int tmp = t.toInt(&valGood);
182 if (valGood == true){
183 if (!(tmp >= 0 && tmp <=9999)){
184
185 }
186 else{
187 int currInd = limitsForm::comboMaxConn->findText(t);
188 if ( currInd < 0){
189 limitsForm::comboMaxConn->addItem(t);
190 limitsForm::comboMaxConn->model()->sort(0);
191 }
192 else{
193 limitsForm::comboMaxConn->setCurrentIndex(currInd);
194 }
195 }
196 }
197 }
198 if (from == limitsForm::comboMaxTime->lineEdit()){ // int, range: space, 0..99999 sec
199 int tmp = t.toInt(&valGood);
200 if (valGood == true){
201 if (!(tmp >= 0 && tmp <=99999)){
202
203 }
204 else{
205 int currInd = limitsForm::comboMaxConn->findText(t);
206 if ( currInd < 0){
207 limitsForm::comboMaxConn->addItem(t);
208 limitsForm::comboMaxConn->model()->sort(0);
209 }
210 else{
211 limitsForm::comboMaxConn->setCurrentIndex(currInd);
212 }
213 }
214 }
215 }
216 if (from == limitsForm::comboMaxTransf->lineEdit()){ // float, range: space, 0..1000 MB/s
217 float tmp = t.toFloat(&valGood);
218 if (valGood == true){
219 if (!(tmp >= 0 && tmp <=1000)){
220
221 }
222 else{
223 int currInd = limitsForm::comboMaxConn->findText(t);
224 if ( currInd < 0){
225 limitsForm::comboMaxConn->addItem(t);
226 limitsForm::comboMaxConn->model()->sort(0);
227 }
228 else{
229 limitsForm::comboMaxConn->setCurrentIndex(currInd);
230 }
231 }
232 }
233 }
234 if (from == limitsForm::comboMaxLinks->lineEdit()){ // int, range: space, 0..5000000
235 int tmp = t.toInt(&valGood);
236 if (valGood == true){
237 if (!(tmp >= 0 && tmp <=5000000)){
238
239 }
240 else{
241 int currInd = limitsForm::comboMaxConn->findText(t);
242 if ( currInd < 0){
243 limitsForm::comboMaxConn->addItem(t);
244 limitsForm::comboMaxConn->model()->sort(0);
245 }
246 else{
247 limitsForm::comboMaxConn->setCurrentIndex(currInd);
248 }
249 }
250 }
251 }
252 }
253
113254 void optionsLimits::initTextPoints()
114255 {
115256 *opts << (trWidgets) {
155296 limitsForm::comboMaxTime, -1, "MaxTime", COMBOBOX, INTEGER, 0
156297 };
157298 *opts << (trWidgets) {
158 limitsForm::comboMaxTransf, -1, "MaxRate", COMBOBOX, INTEGER, 0
299 limitsForm::comboMaxTransf, -1, "MaxRate", COMBOBOX, FLOAT, 0
159300 };
160301 *opts << (trWidgets) {
161302 limitsForm::comboMaxConn, -1, "MaxConn", COMBOBOX, INTEGER, 0
164305 limitsForm::comboMaxLinks, -1, "MaxLinks", COMBOBOX, INTEGER, 0
165306 };
166307 *opts << (trWidgets) {
167 limitsForm::editMaxHtml, -1, "MaxHtml", EDITLINE, INTEGER, 0
168 };
169 *opts << (trWidgets) {
170 limitsForm::editMaxNHtml, -1, "MaxOther", EDITLINE, INTEGER, 0
171 };
172 *opts << (trWidgets) {
173 limitsForm::editMaxSize, -1, "MaxAll", EDITLINE, INTEGER, 0
308 limitsForm::editMaxHtml, -1, "MaxHtml", EDITLINE, FLOAT, 0
309 };
310 *opts << (trWidgets) {
311 limitsForm::editMaxNHtml, -1, "MaxOther", EDITLINE, FLOAT, 0
312 };
313 *opts << (trWidgets) {
314 limitsForm::editMaxSize, -1, "MaxAll", EDITLINE, FLOAT, 0
174315 };
175316 *opts << (trWidgets) {
176317 limitsForm::editPause, -1, "MaxWait", EDITLINE, INTEGER, 0
237237 editor.remove("-" + act + " ");
238238 }
239239
240 if (incl){
240 if (incl) {
241241 editor = "+" + act + " " + editor;
242 }
243 else{
242 } else {
244243 editor = "-" + act + " " + editor;
245244 }
246245
11 #define HTTVERSION_H
22
33 #define HTTQTVERSION "1.1.10"
4 #define PROGRAM_DATE "03 Dez 2013"
4 #define PROGRAM_DATE "07 Dez 2013"
55
66 #endif