Реализован вывод вкладки vte терминала на вкладке "Информация"

pull/4/head
Igor Belitskiy 2 years ago
parent c657e5cffb
commit c8fbab714a

File diff suppressed because it is too large Load Diff

@ -245,8 +245,10 @@ void main_update_information() {
philos_array_string_remove_char(&fill_cmb_2, "\n", size);
}
if (menu_id >= 0) {
g_signal_handlers_disconnect_by_func(G_OBJECT(widgets->cbtMainInfoLevel2), main_cbx_2_event, NULL);
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->cbtMainInfoLevel2));
philos_fill_combo_box_text(widgets->cbtMainInfoLevel2, fill_cmb_2, size);
g_signal_connect(G_OBJECT(widgets->cbtMainInfoLevel2),"changed",G_CALLBACK(main_cbx_2_event), NULL);
// yon_terminal_integrated_launch(widgets->vteProcesses, cmd, NULL, NULL);
}
}
@ -476,18 +478,17 @@ void set_pow_size(char* str_find, int** array_size, char*** array_data , int ind
}
void main_cbx_2_event() {
int menu_id = gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtMainInfo));
char* cmd_text_param = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->cbtMainInfo));
int menu_id = gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtMainInfoLevel2));
char* cmd_text_param = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->cbtMainInfoLevel2));
char* cmd = NULL;
if (menu_id >= 0) {
puts("2222");
cmd = yon_char_unite("systemctl status ", cmd_text_param ," --no-pager", NULL);
yon_terminal_integrated_launch(widgets->vteInformation, cmd, NULL, NULL);
}
if (cmd_text_param != NULL) {
if (menu_id >= 0) {
free(cmd_text_param);
}
if (cmd != NULL) {
if (menu_id >= 0) {
free(cmd);
}
@ -657,7 +658,6 @@ void main_event(main_window *widgets) {
g_signal_connect(G_OBJECT(widgets->btnMainShowAllEmpty), "toggled", G_CALLBACK(main_update_processes), NULL);
g_signal_connect(G_OBJECT(widgets->btnMainShowCoreStream), "toggled", G_CALLBACK(main_update_processes), NULL);
g_signal_connect(G_OBJECT(widgets->cbtMainInfo),"changed",G_CALLBACK(main_update_information), NULL);
g_signal_connect(G_OBJECT(widgets->cbtMainInfoLevel2),"popdown",G_CALLBACK(main_cbx_2_event), NULL);
g_signal_connect(G_OBJECT(widgets->btnDelQuotas), "clicked", G_CALLBACK(tree_view_del_line), widgets);
g_signal_connect(G_OBJECT(widgets->treeViewMain), "cursor-changed", G_CALLBACK(tree_view_select), widgets);
g_signal_connect(G_OBJECT(widgets->LoadGlobalMenuItem), "activate", G_CALLBACK(load_global_cfg), widgets);

@ -15,11 +15,9 @@
#include "view_edit.h"
#include "my_device.h"
#ifdef WEBKIT_FOUND
#include <webkit2/webkit2.h>
#endif
#include <webkit2/webkit2.h>
#endif
#include "ubl-strings.h"
#define WIKI_LINK "https://wiki.ublinux.ru/ru/Программное_обеспечениерограммы_и_утилиты/Все/ubl-settings-resourcequota"
@ -30,19 +28,21 @@
#define banner_path "/usr/share/ubl-settings-resourcequota/images/ubl-settings-resourcequota-banner.png"
#define CssPath "/usr/share/ubl-settings-resourcequota/css/ubl-settings-resourcequota.css"
#define LocalePath "/usr/share/locale"
#define LocalePath "/usr/share/locale"
#define LocaleName "ubl-settings-resourcequota"
#define CMD_LOAD_GLOBAL "ubconfig --default --source global get security"
#define CMD_LOAD_SYSTEM "ubconfig --default --source system get security"
#define CMD_SAVE_GLOBAL "ubconfig --default --source global set security"
#define CMD_SAVE_SYSTEM "ubconfig --default --source system set security"
#define CMD_GET_SLICE_SERVICE "systemd-cgls --no-page"
typedef char* string;
#define CMD_GET_GROUP "cut -d: -f1 /etc/group"
typedef char *string;
string version_application = "";
static char *local;
typedef struct {
typedef struct
{
int always_open_documentation;
int win_pos_x;
int win_pos_y;
@ -52,7 +52,7 @@ typedef struct {
int socket_id;
int load_socket_id;
int save_socket_id;
int lock_help;
int lock_save_local;
int lock_save_global;
@ -77,21 +77,22 @@ typedef struct {
config_str i_o_limit_write;
config_str disk;
int* type_quota_size;
int* quota_volume_size;
int* soft_raw_limit_size;
int* hard_raw_limit_size;
int* swap_size;
int* cpu_limit_size;
int* i_o_limit_read_size;
int* i_o_limit_write_size;
int *type_quota_size;
int *quota_volume_size;
int *soft_raw_limit_size;
int *hard_raw_limit_size;
int *swap_size;
int *cpu_limit_size;
int *i_o_limit_read_size;
int *i_o_limit_write_size;
int size_tree_view;
dictionary* load_global_cfg;
dictionary* load_system_cfg;
dictionary* save_cfg_gui;
dictionary *load_global_cfg;
dictionary *load_system_cfg;
dictionary *save_cfg_gui;
} config;
typedef struct {
typedef struct
{
GtkWidget *Window;
GtkTreeViewColumn *tvc0;
@ -148,8 +149,8 @@ typedef struct {
GtkWidget *AboutMenuItem;
} main_window;
typedef struct {
typedef struct
{
GtkWidget *Window;
GtkWidget *HatText;
@ -159,7 +160,7 @@ typedef struct {
GtkWidget *CloseButton;
GtkWidget *AcceptButton;
} documentation_confirmation_window;
main_window *setup_window();
@ -185,16 +186,15 @@ void tree_view_del_line();
void main_fill_tree_view_after_remove();
void load_system_cfg();
void load_global_cfg();
void template_cfg(char* cmd, dictionary* load_cfg);
void str_split_value(char* values, int index);
void set_pow_size(char* str_find, int** array_size, char*** array_data, int index);
void str_split_key(char* source_value, int index);
void template_cfg(char *cmd, dictionary *load_cfg);
void str_split_value(char *values, int index);
void set_pow_size(char *str_find, int **array_size, char ***array_data, int index);
void str_split_key(char *source_value, int index);
void fill_tree_view(int start, int size, int flag_gui_add);
void clear_array();
void init_cfg_array(int index);
void wrapper_template_save(char* check_flag);
void wrapper_template_save(char *check_flag);
void wrapper_system_save();
void wrapper_global_save();
void wrapper_all_save();
void template_format_str_save(dictionary* load_cfg, char* source_cmd);
void template_format_str_save(dictionary *load_cfg, char *source_cmd);

@ -1100,7 +1100,7 @@ void yon_terminal_integrated_launch(GtkWidget *terminal, char* command, void *en
vte_terminal_set_size(VTE_TERMINAL(terminal),10,15);
VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL);
vte_terminal_set_pty(VTE_TERMINAL(terminal),pty);
char *install_command=yon_char_unite("tput cup 0 0 && tput ed; ",command,"\n",NULL);
char *install_command=yon_char_unite("tput cup 0 0 && tput ed; ",command, "; exit 0\n",NULL);
if(endwork_function)
g_signal_connect(G_OBJECT(terminal), "child-exited", G_CALLBACK(endwork_function), endwork_function_argument);
vte_terminal_spawn_async(VTE_TERMINAL(terminal),
@ -1126,7 +1126,7 @@ void yon_terminal_integrated_launch(GtkWidget *terminal, char* command, void *en
NULL,
NULL,
NULL);
vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), 100);
vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), -1);
vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), TRUE);
vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), TRUE);
gtk_widget_show_all(terminal);

Loading…
Cancel
Save