Добавлено окно добавления квот

pull/2/head
Igor Belitskiy 2 years ago
parent a0915beedb
commit c05b697a58

@ -40,6 +40,8 @@ set(SOURCE_FILES
view/ubl-settings-resourcequota.h
view/filters.c
view/filters.h
view/view_add.c
view/view_add.h
view/ubl-strings.h
view/ubl-utils.h
view/ubl-utils.c

@ -119,6 +119,8 @@ main_window *setup_window(){
main_window *widgets = malloc(sizeof(main_window));
GtkBuilder *builder = gtk_builder_new_from_file(glade_path);
widgets->Window = yon_gtk_builder_get_widget(builder,"MainWindow");
widgets->btnEdit = yon_gtk_builder_get_widget(builder,"btnEdit");
widgets->btnAdd = yon_gtk_builder_get_widget(builder,"btnAdd");
widgets->HatLabel = yon_gtk_builder_get_widget(builder,"headerTopic");
widgets->PlugBox = yon_gtk_builder_get_widget(builder,"plugBox");
@ -157,6 +159,7 @@ main_window *setup_window(){
void event_all(main_window *widgets) {
g_signal_connect(G_OBJECT(widgets->btnShowFilters),"clicked",G_CALLBACK(filters_show),NULL);
g_signal_connect(G_OBJECT(widgets->btnAdd),"clicked",G_CALLBACK(add_show),NULL);
}
void main_event(main_window *widgets) {
@ -249,6 +252,7 @@ int main(int argc, char *argv[]){
main_window *widgets = setup_window();
filters_window *widget_filters = filters_setup_window(glade_path);
add_window *add_widgets = add_setup_window(glade_path);
event_all(widgets);
main_event(widgets);
yon_ubl_header_setup(widgets->HeadOverlay,widgets->HeadBox,widgets->HeadImage,banner_path);

@ -10,9 +10,11 @@
#include <libintl.h>
#include <vte/vte.h>
#include "ubl-cmake.h"
#include "view_add.h"
#include "filters.h"
#ifdef WEBKIT_FOUND
#include <webkit2/webkit2.h>
#endif
@ -53,6 +55,8 @@ typedef struct {
typedef struct {
GtkWidget *Window;
GtkWidget *btnShowFilters;
GtkWidget *btnEdit;
GtkWidget *btnAdd;
GtkWidget *HatLabel;
GtkWidget *PlugBox;

@ -0,0 +1,30 @@
#include "view_add.h"
add_window *add_widgets;
add_window *add_setup_window(char* glade_path){
add_widgets = malloc(sizeof(add_window));
GtkBuilder *builder = gtk_builder_new_from_file(glade_path);
add_widgets->Window = yon_gtk_builder_get_widget(builder,"wndQuotasAddingProject");
return add_widgets;
}
void add_event(add_window *widgets) {
g_signal_connect(G_OBJECT(widgets->btnFiltersCancel),"clicked",G_CALLBACK(add_on_hide_subwindow),NULL);
}
void add_localization(add_window *widgets) {
}
void add_on_hide_subwindow(GtkWidget *self) {
gtk_widget_destroy(gtk_widget_get_toplevel(self));
}
add_window *get_widget_add() {
return add_widgets;
}
void add_show(GtkWidget *self) {
gtk_widget_show_all(add_widgets->Window);
}

@ -0,0 +1,37 @@
#ifndef VIEW_ADD_H
#define VIEW_ADD_H
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include "ubl-utils.h"
#include "ubl-strings.h"
#include <locale.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <libintl.h>
#include <getopt.h>
#include <libintl.h>
// Переменные
typedef struct {
GtkWidget* Window;
GtkWidget* btnFiltersSave;
GtkWidget* btnFiltersCancel;
GtkWidget* chbFilterTypeQouota;
GtkWidget* chbCPULimit;
GtkWidget* chbIOLimitRead;
GtkWidget* chbIOLimitWrite;
GtkWidget* chbSwapFileLimit;
GtkWidget* chbHardLimit;
GtkWidget* chbSoftLimit;
GtkWidget* chbQuotaVolume;
} add_window;
// Функции
add_window *add_setup_window(char* glade_path);
void add_event(add_window *widgets);
void add_localization(add_window *widgets);
void add_on_hide_subwindow(GtkWidget *self);
add_window *get_widget_add();
void add_show(GtkWidget *self);
#endif

@ -811,7 +811,7 @@ translated and supported by community.</property>
<placeholder/>
</child>
<child>
<object class="GtkButton">
<object class="GtkButton" id="btnAdd">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
@ -864,7 +864,7 @@ translated and supported by community.</property>
</packing>
</child>
<child>
<object class="GtkButton">
<object class="GtkButton" id="btnEdit">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
@ -2687,6 +2687,7 @@ translated and supported by community.</property>
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="show-close-button">True</property>
<child type="title">
<object class="GtkLabel" id="Settings disk quotas - Editing1">
<property name="visible">True</property>

Loading…
Cancel
Save