File: Network_Widget.h

package info (click to toggle)
aqemu 0.8.2-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 5,740 kB
  • ctags: 2,347
  • sloc: cpp: 31,857; makefile: 2
file content (118 lines) | stat: -rw-r--r-- 3,251 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/****************************************************************************
**
** Copyright (C) 2009-2010 Andrey Rijov <ANDron142@yandex.ru>
**
** This file is part of AQEMU.
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor,
** Boston, MA  02110-1301, USA.
**
****************************************************************************/

#ifndef NETWORK_WIDGET_H
#define NETWORK_WIDGET_H

#include "ui_Network_Widget.h"
#include "VM_Devices.h"

class Network_Widget: public QWidget
{
	Q_OBJECT
	
	public:
		Network_Widget( QWidget *parent = 0 );
		
		bool Get_Network_Cards( QList<VM_Net_Card_Nativ> &cards );
		void Set_Network_Cards( const QList<VM_Net_Card_Nativ> &cards );
		
		void Set_Network_Card_Models( const QList<Device_Map> &models );
		void Set_Devices( const Available_Devices &devices );
		
		void Set_Enabled( bool on );
		
	private slots:
		void Connect_Slots();
		void Disconnect_Slots();
		
		void on_Button_Add_clicked();
		void on_Button_Delete_clicked();
		void on_Items_List_currentItemChanged( QListWidgetItem *current, QListWidgetItem *previous );
		void on_TB_Help_clicked();
		void on_TB_Browse_script_clicked();
		void on_TB_Browse_downscript_clicked();
		void on_CB_Network_Type_currentIndexChanged( int index );
		void on_TB_Generate_New_MAC_clicked();
		void on_TB_Browse_bootfile_clicked();
		void on_TB_Browse_smb_clicked();
		void on_CH_smb_toggled( bool checked );
		void Update_Card_Item();
		
	private:
		VM_Net_Card_Nativ Get_Net_Card_From_Ui() const;
		void Set_Net_Card_To_Ui( const VM_Net_Card_Nativ &card );
		
		bool Net_Card_is_Valid();
		bool No_File_Found( const QString &name, const QString &path );
		
		QString Get_Items_Count( VM::Network_Mode_Nativ type );
		
		void Enable_Buttons( bool add, bool del );
		
	signals:
		void Changet();
		
	private:
		Ui::Network_Widget ui;
		QList<VM_Net_Card_Nativ> Network_Cards;
		QStringList Card_Models_QEMU_Name;
		int nic, user, chanel, tap, socket, multi, vde, dump;
		
		bool PSO_Net_name;
		bool PSO_Net_addr;
		bool PSO_Net_vectors;
		
		bool PSO_Net_net;
		bool PSO_Net_host;
		bool PSO_Net_restrict;
		bool PSO_Net_dhcpstart;
		bool PSO_Net_dns;
		bool PSO_Net_tftp;
		bool PSO_Net_bootfile;
		bool PSO_Net_smb;
		bool PSO_Net_hostfwd;
		bool PSO_Net_guestfwd;
		
		bool PSO_Net_ifname;
		bool PSO_Net_script;
		bool PSO_Net_downscript;
		bool PSO_Net_sndbuf;
		bool PSO_Net_vnet_hdr;
		bool PSO_Net_vhost;
		bool PSO_Net_vhostfd;
		
		bool PSO_Net_listen;
		bool PSO_Net_connect;
		
		bool PSO_Net_mcast;
		
		bool PSO_Net_sock;
		bool PSO_Net_port;
		bool PSO_Net_group;
		bool PSO_Net_mode;
		
		bool PSO_Net_file;
		bool PSO_Net_len;
};

#endif