Skip to content

Commit

Permalink
* new host cache spinBox
Browse files Browse the repository at this point in the history
git-svn-id: https://nmapsi4.googlecode.com/svn/trunk/nmapsi4@446 c1291736-2539-0410-a836-7dc8ed2dc041
  • Loading branch information
francesco.cecconi committed Jul 20, 2009
1 parent f427559 commit 341022d
Show file tree
Hide file tree
Showing 8 changed files with 216 additions and 144 deletions.
36 changes: 26 additions & 10 deletions nmapsi4-logr/src/mainwin.ui
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<item row="1" column="0">
<widget class="QToolBox" name="toolBoxMain">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
Expand All @@ -41,8 +44,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>797</width>
<height>403</height>
<width>732</width>
<height>451</height>
</rect>
</property>
<attribute name="label">
Expand All @@ -52,10 +55,10 @@
<item>
<widget class="QTreeWidget" name="treeLogView">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
<enum>QFrame::Sunken</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
Expand All @@ -81,7 +84,7 @@
<x>0</x>
<y>0</y>
<width>797</width>
<height>62</height>
<height>434</height>
</rect>
</property>
<attribute name="label">
Expand All @@ -103,10 +106,10 @@
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
<enum>QFrame::Sunken</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
Expand Down Expand Up @@ -135,6 +138,13 @@
</widget>
</widget>
</item>
<item row="0" column="0">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
Expand All @@ -143,7 +153,7 @@
<x>0</x>
<y>0</y>
<width>815</width>
<height>26</height>
<height>24</height>
</rect>
</property>
<widget class="QMenu" name="menu_FIle">
Expand All @@ -165,6 +175,9 @@
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="movable">
<bool>false</bool>
</property>
<property name="iconSize">
<size>
<width>32</width>
Expand All @@ -174,8 +187,11 @@
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="floatable">
<bool>false</bool>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
<enum>RightToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
Expand Down
8 changes: 8 additions & 0 deletions nmapsi4/core/profileSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ void nmapClass::checkProfile()

comboMain->removeItem(2);
}

QString cache = settings.value("hostCache", "none").toString();

if (!cache.compare("none")) {
settings.setValue("hostCache", "10"); // default value
}

hostCache = settings.value("hostCache").toInt();
}

void nmapClass::setQuickProfile()
Expand Down
4 changes: 2 additions & 2 deletions nmapsi4/core/support/searchVuln.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void nmapClass::searchVuln()

QString url;
QString tmp;
history = new logHistory("nmapsi4/cacheVuln", 10);
history = new logHistory("nmapsi4/cacheVuln", hostCache);
history->addItemHistory(comboVulnRis->currentText());
delete history;

Expand Down Expand Up @@ -70,7 +70,7 @@ void nmapClass::callSearchHistoryVuln() {

if (!actionAdd_Bookmark->isEnabled())
actionAdd_Bookmark->setEnabled(true);
logHistory *history = new logHistory("nmapsi4/cacheVuln", 10);
logHistory *history = new logHistory("nmapsi4/cacheVuln", hostCache);
history->searchHistory(comboVulnRis->currentText(), comboVulnRis);
delete history;

Expand Down
2 changes: 1 addition & 1 deletion nmapsi4/core/toolsUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void nmapClass::callSearchHistory()
{
if (!actionAdd_Bookmark->isEnabled())
actionAdd_Bookmark->setEnabled(true);
logHistory *history = new logHistory("nmapsi4/cacheHost", 10);
logHistory *history = new logHistory("nmapsi4/cacheHost", hostCache);
history->searchHistory(hostEdit->currentText(), hostEdit);
delete history;
}
Expand Down
6 changes: 3 additions & 3 deletions nmapsi4/mainwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ nmapClass::nmapClass()
this->checkProfile();
this->optionListCreate();

logHistory *historyScan_ = new logHistory(treeLogH, "nmapsi4/urlList", "nmapsi4/urlListTime", 10);
logHistory *historyScan_ = new logHistory(treeLogH, "nmapsi4/urlList", "nmapsi4/urlListTime", hostCache);
historyScan_->updateBookMarks();
delete historyScan_;
logHistory *historyVuln_ = new logHistory(treeBookVuln, "nmapsi4/urlListVuln", "nmapsi4/urlListTimeVuln", 10);
logHistory *historyVuln_ = new logHistory(treeBookVuln, "nmapsi4/urlListVuln", "nmapsi4/urlListTimeVuln", hostCache);
historyVuln_->updateBookMarks();
delete historyVuln_;
}
Expand Down Expand Up @@ -144,7 +144,7 @@ void nmapClass::scan(QString hostname)
QStringList parametri; //parameters list declaration
QString title;

history = new logHistory("nmapsi4/cacheHost", 10);
history = new logHistory("nmapsi4/cacheHost", hostCache);
history->addItemHistory(hostname);

title.append("NmapSI4 ");
Expand Down
1 change: 1 addition & 0 deletions nmapsi4/mainwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class nmapClass : public QMainWindow , private Ui::MainWindow
bool saveSize;
bool listClearFlag;
bool verboseLog;
int hostCache;
QList<QTreeWidgetItem*> itemList;
QList<QTreeWidgetItem*> itemListLook;
QString logSessionFile;
Expand Down
8 changes: 6 additions & 2 deletions nmapsi4/preference/profilemain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ mainProfile::mainProfile()
else
checkVerboseLog->setChecked(false);

QString cache = ptrFile.value("hostCache", "10").toString();
spinBoxCache->setValue(cache.toInt());

// Create listview items
// TODO insert history item and window setup
listViewOptions->setIconSize(QSize::QSize(52, 52));
Expand Down Expand Up @@ -123,8 +126,9 @@ QString mainProfile::readProfile()
void mainProfile::setScan()
{
QSettings ptrFile("nmapsi4", "nmapsi4");
ptrFile.setValue("configProfile", ScanActive); // default value
ptrFile.setValue("confPath", lineEditPath->text()); // default value
ptrFile.setValue("configProfile", ScanActive);
ptrFile.setValue("confPath", lineEditPath->text());
ptrFile.setValue("hostCache", spinBoxCache->value());

if (checkLogOn->isChecked()) // update checklog from configuration file
ptrFile.setValue("logCheck", "true");
Expand Down
Loading

0 comments on commit 341022d

Please sign in to comment.