Skip to content

Commit

Permalink
Update file(s): 2024-06-27
Browse files Browse the repository at this point in the history
  • Loading branch information
horsicq committed Jun 27, 2024
1 parent 29074e3 commit da6608e
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 65 deletions.
4 changes: 1 addition & 3 deletions dialognfdscan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@

#include "ui_dialognfdscan.h"

DialogNFDScan::DialogNFDScan(QWidget *pParent) : QDialog(pParent), ui(new Ui::DialogNFDScan)
DialogNFDScan::DialogNFDScan(QWidget *pParent) : XShortcutsDialog(pParent), ui(new Ui::DialogNFDScan)
{
ui->setupUi(this);

setWindowFlags(Qt::Window);
}

DialogNFDScan::~DialogNFDScan()
Expand Down
8 changes: 7 additions & 1 deletion dialognfdscan.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,31 @@
#ifndef DIALOGNFDSCAN_H
#define DIALOGNFDSCAN_H

#include "xshortcutsdialog.h"
#include "dialognfdscanprocess.h"
#include "xoptions.h"

namespace Ui {
class DialogNFDScan;
}

class DialogNFDScan : public QDialog {
class DialogNFDScan : public XShortcutsDialog {
Q_OBJECT

public:
explicit DialogNFDScan(QWidget *pParent);
~DialogNFDScan();

virtual void adjustView() {}

void setData(QIODevice *pDevice, bool bScan, XBinary::FT fileType);

private slots:
void on_pushButtonClose_clicked();

protected:
virtual void registerShortcuts(bool bState) { Q_UNUSED(bState) }

private:
Ui::DialogNFDScan *ui;
};
Expand Down
5 changes: 5 additions & 0 deletions dialognfdscandirectory.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class DialogNFDScanDirectory : public XShortcutsDialog {
explicit DialogNFDScanDirectory(QWidget *pParent, const QString &sDirName);
~DialogNFDScanDirectory();

virtual void adjustView() {}

private slots:
void on_pushButtonOpenDirectory_clicked();
void on_pushButtonScan_clicked();
Expand All @@ -53,6 +55,9 @@ private slots:
signals:
void resultSignal(const QString &sText);

protected:
virtual void registerShortcuts(bool bState) { Q_UNUSED(bState) }

private:
Ui::DialogNFDScanDirectory *ui;
};
Expand Down
10 changes: 5 additions & 5 deletions dialognfdscandirectory.ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>725</width>
<width>783</width>
<height>478</height>
</rect>
</property>
Expand All @@ -30,16 +30,16 @@
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>1</number>
<number>2</number>
</property>
<property name="topMargin">
<number>1</number>
<number>2</number>
</property>
<property name="rightMargin">
<number>1</number>
<number>2</number>
</property>
<property name="bottomMargin">
<number>1</number>
<number>2</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
Expand Down
2 changes: 1 addition & 1 deletion dialognfdwidgetadvanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ DialogNFDWidgetAdvanced::~DialogNFDWidgetAdvanced()
delete ui;
}

void DialogNFDWidgetAdvanced::setData(QString sFileName, SpecAbstract::SCAN_OPTIONS options, bool bScan)
void DialogNFDWidgetAdvanced::setData(const QString &sFileName, SpecAbstract::SCAN_OPTIONS options, bool bScan)
{
ui->widgetScan->setData(sFileName, options, bScan);
}
Expand Down
7 changes: 6 additions & 1 deletion dialognfdwidgetadvanced.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,16 @@ class DialogNFDWidgetAdvanced : public XShortcutsDialog {
explicit DialogNFDWidgetAdvanced(QWidget *pParent = nullptr);
~DialogNFDWidgetAdvanced();

void setData(QString sFileName, SpecAbstract::SCAN_OPTIONS options, bool bScan);
virtual void adjustView() {}

void setData(const QString &sFileName, SpecAbstract::SCAN_OPTIONS options, bool bScan);

private slots:
void on_pushButtonClose_clicked();

protected:
virtual void registerShortcuts(bool bState) { Q_UNUSED(bState) }

private:
Ui::DialogNFDWidgetAdvanced *ui;
};
Expand Down
4 changes: 4 additions & 0 deletions nfd_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ void NFD_Widget::setGlobal(XShortcuts *pShortcuts, XOptions *pXOptions)
XShortcutsWidget::setGlobal(pShortcuts, pXOptions);
}

void NFD_Widget::adjustView()
{
}

void NFD_Widget::clear()
{
g_scanType = ST_UNKNOWN;
Expand Down
1 change: 1 addition & 0 deletions nfd_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class NFD_Widget : public XShortcutsWidget {

void setData(const QString &sFileName, bool bScan = false, XBinary::FT fileType = XBinary::FT_UNKNOWN);
void setGlobal(XShortcuts *pShortcuts, XOptions *pXOptions);
virtual void adjustView();

private slots:
void clear();
Expand Down
7 changes: 6 additions & 1 deletion nfdoptionswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "ui_nfdoptionswidget.h"

NFDOptionsWidget::NFDOptionsWidget(QWidget *pParent) : QWidget(pParent), ui(new Ui::NFDOptionsWidget)
NFDOptionsWidget::NFDOptionsWidget(QWidget *pParent) : XShortcutsWidget(pParent), ui(new Ui::NFDOptionsWidget)
{
ui->setupUi(this);

Expand All @@ -36,6 +36,11 @@ NFDOptionsWidget::~NFDOptionsWidget()
delete ui;
}

void NFDOptionsWidget::adjustView()
{
// TODO
}

void NFDOptionsWidget::setOptions(XOptions *pOptions)
{
g_pOptions = pOptions;
Expand Down
8 changes: 4 additions & 4 deletions nfdoptionswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@
#ifndef NFDOPTIONSWIDGET_H
#define NFDOPTIONSWIDGET_H

#include <QWidget>

#include "xoptions.h"
#include "xshortcutswidget.h"

namespace Ui {
class NFDOptionsWidget;
}

class NFDOptionsWidget : public QWidget {
class NFDOptionsWidget : public XShortcutsWidget {
Q_OBJECT

public:
explicit NFDOptionsWidget(QWidget *pParent = nullptr);
~NFDOptionsWidget();

virtual void adjustView();

void setOptions(XOptions *pOptions);

static void setDefaultValues(XOptions *pOptions);
Expand Down
2 changes: 1 addition & 1 deletion nfdwidgetadvanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void NFDWidgetAdvanced::setData(QIODevice *pDevice, bool bScan, XBinary::FT file
}
}

void NFDWidgetAdvanced::setData(QString sFileName, SpecAbstract::SCAN_OPTIONS options, bool bScan)
void NFDWidgetAdvanced::setData(const QString &sFileName, SpecAbstract::SCAN_OPTIONS options, bool bScan)
{
this->g_sFileName = sFileName;
this->g_fileType = options.fileType;
Expand Down
4 changes: 2 additions & 2 deletions nfdwidgetadvanced.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class NFDWidgetAdvanced : public XShortcutsWidget {
~NFDWidgetAdvanced();

void setData(QIODevice *pDevice, bool bScan, XBinary::FT fileType);
void setData(QString sFileName, SpecAbstract::SCAN_OPTIONS options, bool bScan);
void setData(const QString &sFileName, SpecAbstract::SCAN_OPTIONS options, bool bScan);
// TODO Memory scan

void adjustView();
virtual void adjustView();
void setGlobal(XShortcuts *pShortcuts, XOptions *pXOptions);

private slots:
Expand Down
131 changes: 85 additions & 46 deletions nfdwidgetadvanced.ui
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
<number>2</number>
</property>
<property name="topMargin">
<number>0</number>
<number>2</number>
</property>
<property name="rightMargin">
<number>0</number>
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>2</number>
</property>
<item>
<widget class="QComboBox" name="comboBoxType"/>
Expand All @@ -59,43 +59,77 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxRecursiveScan">
<property name="text">
<string>Recursive scan</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxDeepScan">
<property name="text">
<string>Deep scan</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxHeuristicScan">
<property name="text">
<string>Heuristic scan</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxVerbose">
<property name="text">
<string>Verbose</string>
<widget class="QGroupBox" name="groupBoxOptions">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="checked">
<bool>true</bool>
<property name="title">
<string>Options</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QCheckBox" name="checkBoxRecursiveScan">
<property name="text">
<string>Recursive scan</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxDeepScan">
<property name="text">
<string>Deep scan</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxHeuristicScan">
<property name="text">
<string>Heuristic scan</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxVerbose">
<property name="text">
<string>Verbose</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxAllTypesScan">
<property name="text">
<string>All types</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
Expand All @@ -111,22 +145,27 @@
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBoxAllTypesScan">
<property name="text">
<string>All types</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonSave">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonScan">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Scan</string>
</property>
Expand Down

0 comments on commit da6608e

Please sign in to comment.