Skip to content

Commit

Permalink
* Ui++
Browse files Browse the repository at this point in the history
* copyright++
* code++
* translations++
  • Loading branch information
fcecconi committed Jan 5, 2010
1 parent 642a2cf commit 88f65ff
Show file tree
Hide file tree
Showing 13 changed files with 1,160 additions and 918 deletions.
12 changes: 8 additions & 4 deletions nmapsi4/core/nmapsi4Slot.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2007-2009 by Francesco Cecconi *
* Copyright (C) 2007-2010 by Francesco Cecconi *
* francesco.cecconi@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down Expand Up @@ -161,8 +161,12 @@ void nmapClass::setNmapsiSlot()
connect(action_Add_BookmarkToolBar, SIGNAL(triggered()),
this, SLOT(saveBookMarks()));

// combo session
connect(comboMain, SIGNAL(activated(const QString&)),
this, SLOT(updateMainSlide()));
// main session
connect(scanSez_, SIGNAL(triggered()),
this, SLOT(updateSezScan()));
connect(logSez_, SIGNAL(triggered()),
this, SLOT(updateSezLog()));
connect(vulnSez_, SIGNAL(triggered()),
this, SLOT(updateSezVuln()));

}
10 changes: 4 additions & 6 deletions nmapsi4/core/profileSession.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2007-2009 by Francesco Cecconi *
* Copyright (C) 2007-2010 by Francesco Cecconi *
* francesco.cecconi@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down Expand Up @@ -135,14 +135,12 @@ void nmapClass::checkProfile()
if((!vulnExt.compare("none"))) {
settings.setValue("vulnFlag", "true"); // default value
} else if((vulnExt.compare("false"))) {
comboMain->insertItem(2, tr("Vulnerabilities"));
vulnSez_->setEnabled(true);
} else {
if(comboMain->currentIndex() == 2) {
if(stackedMain->currentIndex() == 2) {
stackedMain->setCurrentIndex(0);
comboMain->setCurrentIndex(0);
}

comboMain->removeItem(2);
vulnSez_->setEnabled(false);
}

QString cache = settings.value("hostCache", "none").toString();
Expand Down
6 changes: 3 additions & 3 deletions nmapsi4/core/toolsUI.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2007-2009 by Francesco Cecconi *
* Copyright (C) 2007-2010 by Francesco Cecconi *
* francesco.cecconi@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down Expand Up @@ -302,7 +302,7 @@ void nmapClass::saveBookMarks()

logHistory *history_ = NULL;

switch(comboMain->currentIndex()) {
switch(stackedMain->currentIndex()) {
case 0:
history_ = new logHistory(treeLogH, "nmapsi4/urlList", "nmapsi4/urlListTime", -1);
history_->addItemHistory(hostEdit->currentText(), QDateTime::currentDateTime().toString("ddd MMMM d yy - hh:mm:ss.zzz"));
Expand All @@ -327,7 +327,7 @@ void nmapClass::deleteBookMark()
if(!treeLogH->currentItem() && !treeBookVuln->currentItem())
return;

switch(comboMain->currentIndex()) {
switch(stackedMain->currentIndex()) {
case 0:
history_ = new logHistory(treeLogH, "nmapsi4/urlList", "nmapsi4/urlListTime", -1);
history_->deleteItemBookmark(treeLogH->currentItem()->text(0));
Expand Down
68 changes: 37 additions & 31 deletions nmapsi4/core/updateUI.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2007-2009 by Francesco Cecconi *
* Copyright (C) 2007-2010 by Francesco Cecconi *
* francesco.cecconi@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down Expand Up @@ -337,34 +337,40 @@ void nmapClass::setProgress() {
this->setWindowTitle("Nmapsi4 (60%)");
}

void nmapClass::updateMainSlide() {

switch(comboMain->currentIndex()) {
case 0:
// scan
stackedMain->setCurrentIndex(0);
this->showMainToolBar();
this->showActionToolBar();
break;
case 1:
// log
stackedMain->setCurrentIndex(1);
// main and action bar only in scan index
toolBar->setVisible(false);
actionMain_Toolbars->setChecked(false);
toolBar_2->setVisible(false);
toolBarBook->setVisible(false);
actionActions_Toolbar->setChecked(false);
break;
case 2:
// Vuln
stackedMain->setCurrentIndex(2);
// main and action bar only in scan index
toolBar->setVisible(false);
toolBarBook->setVisible(true);
actionMain_Toolbars->setChecked(false);
toolBar_2->setVisible(false);
actionActions_Toolbar->setChecked(false);
break;
}
void nmapClass::updateSezScan() { // SLOT

if(stackedMain->currentIndex() == 0)
return;

stackedMain->setCurrentIndex(0);
this->showMainToolBar();
this->showActionToolBar();
}

void nmapClass::updateSezLog() { // SLOT

if(stackedMain->currentIndex() == 1)
return;

stackedMain->setCurrentIndex(1);
// main and action bar only in scan index
toolBar->setVisible(false);
actionMain_Toolbars->setChecked(false);
toolBar_2->setVisible(false);
toolBarBook->setVisible(false);
actionActions_Toolbar->setChecked(false);
}

void nmapClass::updateSezVuln() { // SLOT

if(stackedMain->currentIndex() == 2)
return;

stackedMain->setCurrentIndex(2);
// main and action bar only in scan index
toolBar->setVisible(false);
toolBarBook->setVisible(true);
actionMain_Toolbars->setChecked(false);
toolBar_2->setVisible(false);
actionActions_Toolbar->setChecked(false);
}
23 changes: 23 additions & 0 deletions nmapsi4/mainwin.cpp
Expand Up @@ -34,6 +34,26 @@ void nmapClass::initGUI()
setupUi(this);
hostEdit->setStyleSheet(QString::fromUtf8("color: rgb(153, 153, 153);"));
hostEdit->insertItem(0, tr("Insert [ip] or [dns] or [ip range] to scan (ip range ex. 192.168.1.10/20 )"));
// Section QAction
scanSez_ = new QAction(this);
scanSez_->setIcon(QIcon(QString::fromUtf8(":/images/images/network_local.png")));
scanSez_->setIconText(tr("Scan"));
scanSez_->setToolTip(tr("Scan host(s)"));

logSez_ = new QAction(this);
logSez_->setIcon(QIcon(QString::fromUtf8(":/images/images/book.png")));
logSez_->setIconText(tr("Log"));
logSez_->setToolTip(tr("Scan Log"));

vulnSez_ = new QAction(this);
vulnSez_->setIcon(QIcon(QString::fromUtf8(":/images/images/viewmag+.png")));
vulnSez_->setIconText(tr("Services"));
vulnSez_->setToolTip(tr("Check Vulnerabilities"));

sezBar->addAction(scanSez_);
sezBar->addAction(logSez_);
sezBar->addAction(vulnSez_);

setNmapsiSlot();
}

Expand Down Expand Up @@ -232,5 +252,8 @@ nmapClass::~nmapClass()
delete labelVersion;
delete userMode;
delete digC;
delete scanSez_;
delete logSez_;
delete vulnSez_;
}

8 changes: 6 additions & 2 deletions nmapsi4/mainwin.h
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2007-2009 by Francesco Cecconi *
* Copyright (C) 2007-2010 by Francesco Cecconi *
* francesco.cecconi@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down Expand Up @@ -104,6 +104,7 @@ class nmapClass : public QMainWindow , private Ui::MainWindow
QList<QString> monitorElemState;
QList<QTreeWidgetItem*> monitorElem;
digSupport *digC;
QAction *scanSez_, *logSez_, *vulnSez_;


public slots:
Expand Down Expand Up @@ -156,7 +157,10 @@ private slots:
void optionListCreate();
void optionListUpdate();
void setProgress();
void updateMainSlide();

void updateSezScan();
void updateSezLog();
void updateSezVuln();

// Vuln extension
void searchVuln();
Expand Down

0 comments on commit 88f65ff

Please sign in to comment.