~brand-nmapsi4/nmapsi4/master

« back to all changes in this revision

Viewing changes to nmapsi4/app/startupTools.cpp

  • Committer: Francesco Cecconi
  • Date: 2011-12-18 11:02:04 UTC
  • Revision ID: git-v1:60a69e132c8ffeb2727e558b2b2e8ac1713e332e
Removed nmapsi4-logr (dedicate repository) but it could be deprecated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2011 by Francesco Cecconi                               *
3
 
 *   francesco.cecconi@gmail.com                                           *
4
 
 *                                                                         *
5
 
 *   This program is free software; you can redistribute it and/or modify  *
6
 
 *   it under the terms of the GNU General Public License as published by  *
7
 
 *   the Free Software Foundation; either version 2 of the License.        *
8
 
 *                                                                         *
9
 
 *   This program is distributed in the hope that it will be useful,       *
10
 
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 
 *   GNU General Public License for more details.                          *
13
 
 *                                                                         *
14
 
 *   You should have received a copy of the GNU General Public License     *
15
 
 *   along with this program; if not, write to the                         *
16
 
 *   Free Software Foundation, Inc.,                                       *
17
 
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 
 ***************************************************************************/
19
 
 
20
 
#include "mainwin.h"
21
 
 
22
 
void nmapClass::startProfile_ui()   // start preference UI
23
 
{
24
 
    mainProfile dialogPreference_(this);
25
 
    connect(&dialogPreference_, SIGNAL(accepted()),
26
 
            this, SLOT(readProfile()));
27
 
 
28
 
    dialogPreference_.exec();
29
 
}
30
 
 
31
 
void nmapClass::exit()
32
 
{
33
 
    _monitor->clearHostMonitor();
34
 
 
35
 
    if (!FileName.isNull())
36
 
    {
37
 
 
38
 
        QFile *tmpFile = new QFile();
39
 
        QString newFile = logPath;
40
 
        newFile.append("/");
41
 
        newFile = QDir::toNativeSeparators(newFile);
42
 
        newFile.append(FileName);
43
 
        tmpFile->setFileName(newFile);
44
 
 
45
 
        if ((checkLog) && (tmpFile->exists()))
46
 
        {
47
 
            tmpFile->close();
48
 
            isEmptyLog();
49
 
        }
50
 
        else if ((!checkLog) && (tmpFile->exists()))
51
 
        { // if log check is disable but the file exist
52
 
                tmpFile->close();
53
 
                tmpFile->remove();
54
 
        }
55
 
 
56
 
        delete tmpFile;
57
 
    }
58
 
 
59
 
    // Save window size and position and NSS info
60
 
    saveUiSettings();
61
 
    close();
62
 
}
63
 
 
64
 
void nmapClass::stop_scan()
65
 
{
66
 
    // stop and clear clear thread
67
 
    _monitor->clearHostMonitor();
68
 
}