attac_detection_new_window

This commit is contained in:
pavanvpatil 2022-08-11 15:24:41 +05:30
parent f598567844
commit f959d00e6a
4 changed files with 28 additions and 3 deletions

View File

@ -43,6 +43,7 @@ FILE4 = ipdcLogo1.png
FILE5 = logo.png
FILE6 = iPDC.desktop
CC = gcc
LIBS = -lpthread
LDLIBS=`pkg-config --cflags --libs gtk+-3.0`
@ -56,9 +57,10 @@ SOURCES = \
parser.c parser.h \
dallocate.c dallocate.h \
align_sort.c align_sort.h \
ipdcGui.c ipdcGui.h
ipdcGui.c ipdcGui.h \
attack_detection.c attack_detection.h
OBJECTS = ipdc.c recreate.o connections.o new_pmu_or_pdc.o parser.o dallocate.o align_sort.o ipdcGui.o
OBJECTS = ipdc.c recreate.o connections.o new_pmu_or_pdc.o parser.o dallocate.o align_sort.o ipdcGui.o attack_detection.o
CLEAN_OBJECTS = recreate.o connections.o new_pmu_or_pdc.o parser.o dallocate.o align_sort.o ipdcGui.o iPDC.xml

19
iPDC/attack_detection.c Normal file
View File

@ -0,0 +1,19 @@
#include<gtk/gtk.h>
#include<stdio.h>
void attack_detection_window(GtkButton *widget,gpointer udata)
{
GtkWidget *new_window;
new_window = gtk_dialog_new();
//gtk_window_fullscreen(GTK_WINDOW(new_window));
gtk_window_set_default_size(GTK_WINDOW(new_window), 800, 600);
gtk_window_set_resizable(GTK_WINDOW(new_window), FALSE);
gtk_window_set_position(GTK_WINDOW(new_window), GTK_WIN_POS_CENTER);
//gtk_window_set_icon(GTK_WINDOW(new_window), create_pixbuf("/usr/local/share/iPDC/logo.png"));
/* Set the Title of Main Window */
gtk_window_set_title (GTK_WINDOW (new_window), "iPDC");
g_signal_connect (new_window, "destroy", G_CALLBACK(gtk_widget_destroy), new_window);
gtk_widget_show(new_window);
}

3
iPDC/attack_detection.h Normal file
View File

@ -0,0 +1,3 @@
#include<gtk/gtk.h>
void attack_detection_window(GtkButton *widget,gpointer udata);

View File

@ -45,6 +45,7 @@
#include "parser.h"
#include "global.h"
#include "ipdcGui.h"
#include "attack_detection.h"
/* Common fixed path for storage of few common files */
#define UI_fILE "/home/pavan/Desktop/iPDC-suite/iPDC/iPDC.ui"
@ -259,7 +260,7 @@ int main(int argc, char **argv)
g_signal_connect (data->remove_pmu_button, "clicked", G_CALLBACK(cmd_or_remove_pmu), (gpointer) "1");
g_signal_connect (data->menu_remove_source, "activate", G_CALLBACK(cmd_or_remove_pmu), (gpointer) "1");
g_signal_connect(data->attack_detection,"activate",G_CALLBACK(add_pmu),NULL);
g_signal_connect(data->attack_detection,"activate",G_CALLBACK(attack_detection_window),NULL);
g_signal_connect (data->cmd_data_off_button, "clicked", G_CALLBACK(cmd_or_remove_pmu), (gpointer) "2");
g_signal_connect (data->menu_data_off, "activate", G_CALLBACK(cmd_or_remove_pmu), (gpointer) "2");