parent
33473a28da
commit
6454a5c0e7
@ -1,29 +0,0 @@
|
|||||||
#include "my_device.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Devices {
|
|
||||||
|
|
||||||
map_str_str Parted::get_parted() {
|
|
||||||
string cmd = "lsblk --fs --raw --output PATH,FSTYPE --exclude 7,11,253";
|
|
||||||
string response = obj_process_call.call_all_sections(cmd);
|
|
||||||
vector<string> vec_parted = Utils::split(response, '\n');
|
|
||||||
map_str_str dict_parted;
|
|
||||||
string key = "";
|
|
||||||
string value = "";
|
|
||||||
if (vec_parted.size()>1) {
|
|
||||||
vec_parted.erase(vec_parted.begin());
|
|
||||||
}
|
|
||||||
for (const string& str_parted : vec_parted) {
|
|
||||||
key = str_parted.substr(0, str_parted.find(" "));
|
|
||||||
if (str_parted.find(" ") != string::npos) {
|
|
||||||
value = str_parted.substr(str_parted.find(" ") + 1, str_parted.length());
|
|
||||||
if (value.length()>0) {
|
|
||||||
dict_parted[key] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return dict_parted;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
#ifndef MY_DEVICE_H
|
|
||||||
#define MY_DEVICE_H
|
|
||||||
|
|
||||||
#include "../../project_lib.h"
|
|
||||||
#include "my_process.h"
|
|
||||||
#include "util.h"
|
|
||||||
#include "../../my_type.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Devices {
|
|
||||||
class Parted{
|
|
||||||
protected:
|
|
||||||
My_Process::My_Process_call obj_process_call = My_Process::My_Process_call();
|
|
||||||
public:
|
|
||||||
map_str_str get_parted();
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
|||||||
|
#include "view_edit_user_group.h"
|
||||||
|
|
||||||
|
View_edit_user_group::View_edit_user_group(/* args */) {
|
||||||
|
builder = Gtk::Builder::create_from_file(path_glade);
|
||||||
|
this->settings();
|
||||||
|
}
|
||||||
|
|
||||||
|
View_edit_user_group::~View_edit_user_group()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::setting() {
|
||||||
|
this->get_builder();
|
||||||
|
this->lacalization();
|
||||||
|
|
||||||
|
this->event();
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::event() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::show() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::get_builder() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::lacalization();
|
||||||
|
|
||||||
|
|
||||||
|
void View_edit_user_group::check_limit(Gtk::CheckButton *check_button, Gtk::SpinButton *spin, Gtk::ComboBoxText *combo_box) {
|
||||||
|
spin->set_sensitive(check_button->get_active());
|
||||||
|
combo_box->set_sensitive(check_button->get_active());
|
||||||
|
}
|
||||||
|
void View_edit_user_group::check_limit(Gtk::CheckButton *check_button, Gtk::SpinButton *spin, Gtk::Label *combo_box) {
|
||||||
|
spin->set_sensitive(check_button->get_active());
|
||||||
|
combo_box->set_sensitive(check_button->get_active());
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::fill_in_pow_memory(Gtk::ComboBoxText *cb_text) {
|
||||||
|
cb_text->append(str_prefix_KB);
|
||||||
|
cb_text->append(str_prefix_MB);
|
||||||
|
cb_text->append(str_prefix_GB);
|
||||||
|
cb_text->append(str_prefix_TB);
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::set_label_type_quota(string name) {
|
||||||
|
->set_text(name);
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
#ifndef VIEW_ADD_USER_GROUP_H
|
||||||
|
#define VIEW_ADD_USER_GROUP_H
|
||||||
|
#include "../project_lib.h"
|
||||||
|
#include "../var.h"
|
||||||
|
class View_edit_user_group
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
Glib::RefPtr<Gtk::Builder> builder;
|
||||||
|
public:
|
||||||
|
View_edit_user_group(/* args */);
|
||||||
|
~View_edit_user_group();
|
||||||
|
void setting();
|
||||||
|
void event();
|
||||||
|
void show();
|
||||||
|
void get_builder();
|
||||||
|
void check_limit(Gtk::CheckButton *check_button, Gtk::SpinButton *spin, Gtk::ComboBoxText *combo_box);
|
||||||
|
void check_limit(Gtk::CheckButton *check_button, Gtk::SpinButton *spin, Gtk::Label *combo_box);
|
||||||
|
void fill_in_pow_memory(Gtk::ComboBoxText *cb_text);
|
||||||
|
void set_label_type_quota(string name);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,52 @@
|
|||||||
|
#include "view_edit_user_group.h"
|
||||||
|
|
||||||
|
View_edit_user_group::View_edit_user_group(/* args */) {
|
||||||
|
builder = Gtk::Builder::create_from_file(path_glade);
|
||||||
|
this->settings();
|
||||||
|
}
|
||||||
|
|
||||||
|
View_edit_user_group::~View_edit_user_group()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::setting() {
|
||||||
|
this->get_builder();
|
||||||
|
this->lacalization();
|
||||||
|
|
||||||
|
this->event();
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::event() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::show() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::get_builder() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::lacalization();
|
||||||
|
|
||||||
|
|
||||||
|
void View_edit_user_group::check_limit(Gtk::CheckButton *check_button, Gtk::SpinButton *spin, Gtk::ComboBoxText *combo_box) {
|
||||||
|
spin->set_sensitive(check_button->get_active());
|
||||||
|
combo_box->set_sensitive(check_button->get_active());
|
||||||
|
}
|
||||||
|
void View_edit_user_group::check_limit(Gtk::CheckButton *check_button, Gtk::SpinButton *spin, Gtk::Label *combo_box) {
|
||||||
|
spin->set_sensitive(check_button->get_active());
|
||||||
|
combo_box->set_sensitive(check_button->get_active());
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::fill_in_pow_memory(Gtk::ComboBoxText *cb_text) {
|
||||||
|
cb_text->append(str_prefix_KB);
|
||||||
|
cb_text->append(str_prefix_MB);
|
||||||
|
cb_text->append(str_prefix_GB);
|
||||||
|
cb_text->append(str_prefix_TB);
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::set_label_type_quota(string name) {
|
||||||
|
->set_text(name);
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
#ifndef VIEW_ADD_USER_GROUP_H
|
||||||
|
#define VIEW_ADD_USER_GROUP_H
|
||||||
|
#include "../project_lib.h"
|
||||||
|
#include "../var.h"
|
||||||
|
class View_edit_user_group
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
Glib::RefPtr<Gtk::Builder> builder;
|
||||||
|
public:
|
||||||
|
View_edit_user_group(/* args */);
|
||||||
|
~View_edit_user_group();
|
||||||
|
void setting();
|
||||||
|
void event();
|
||||||
|
void show();
|
||||||
|
void get_builder();
|
||||||
|
void check_limit(Gtk::CheckButton *check_button, Gtk::SpinButton *spin, Gtk::ComboBoxText *combo_box);
|
||||||
|
void check_limit(Gtk::CheckButton *check_button, Gtk::SpinButton *spin, Gtk::Label *combo_box);
|
||||||
|
void fill_in_pow_memory(Gtk::ComboBoxText *cb_text);
|
||||||
|
void set_label_type_quota(string name);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,114 @@
|
|||||||
|
#include "view_edit_user_group.h"
|
||||||
|
|
||||||
|
View_edit_user_group::View_edit_user_group(/* args */) {
|
||||||
|
builder = Gtk::Builder::create_from_file(path_glade);
|
||||||
|
this->setting();
|
||||||
|
}
|
||||||
|
|
||||||
|
View_edit_user_group::~View_edit_user_group()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::setting() {
|
||||||
|
this->get_builder();
|
||||||
|
this->lacalization();
|
||||||
|
|
||||||
|
this->event();
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::event() {
|
||||||
|
btnCancelEditUser->signal_clicked().connect([&]() {wndQuotasEditUser->hide();});
|
||||||
|
btnSaveEditUser->signal_clicked().connect([&]() {});
|
||||||
|
quotegroupSizeSoftLimitCheckUser->signal_toggled().connect([&]() {
|
||||||
|
check_limit(quotegroupSizeSoftLimitCheckUser
|
||||||
|
,quotegroupSizeSoftLimitSpinUser
|
||||||
|
,quotegroupSizeSoftLimitComboUser);
|
||||||
|
});
|
||||||
|
quotegroupSizeHardLimitCheckUser->signal_toggled().connect([&]() {
|
||||||
|
check_limit(quotegroupSizeHardLimitCheckUser
|
||||||
|
,quotegroupSizeHardLimitSpinUser
|
||||||
|
,quotegroupSizeHardLimitComboUser);
|
||||||
|
});
|
||||||
|
quotegroupFilesSoftLimitCheckUser->signal_toggled().connect([&]() {
|
||||||
|
check_limit(quotegroupFilesSoftLimitCheckUser
|
||||||
|
,quotegroupFilesSoftLimitSpinUser
|
||||||
|
,quotegroupFilesSoftLimitlabelUser);
|
||||||
|
});
|
||||||
|
quotegroupFilesHardLimitCheckUser->signal_toggled().connect([&]() {
|
||||||
|
check_limit(quotegroupFilesHardLimitCheckUser
|
||||||
|
,quotegroupFilesHardLimitSpinUser
|
||||||
|
,quotegroupFilesHarLimitLabelUser);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::get_builder() {
|
||||||
|
builder->get_widget("wndQuotasEditUser", wndQuotasEditUser);
|
||||||
|
builder->get_widget("btnCancelEditUser", btnCancelEditUser);
|
||||||
|
builder->get_widget("btnSaveEditUser", btnSaveEditUser);
|
||||||
|
builder->get_widget("quotegroupSizeSoftLimitCheckUser", quotegroupSizeSoftLimitCheckUser);
|
||||||
|
builder->get_widget("quotegroupSizeHardLimitCheckUser", quotegroupSizeHardLimitCheckUser);
|
||||||
|
builder->get_widget("quotegroupFilesSoftLimitCheckUser", quotegroupFilesSoftLimitCheckUser);
|
||||||
|
builder->get_widget("quotegroupFilesHardLimitCheckUser", quotegroupFilesHardLimitCheckUser);
|
||||||
|
builder->get_widget("quotegroupSizeSoftLimitSpinUser", quotegroupSizeSoftLimitSpinUser);
|
||||||
|
builder->get_widget("quotegroupSizeHardLimitSpinUser", quotegroupSizeHardLimitSpinUser);
|
||||||
|
builder->get_widget("quotegroupFilesSoftLimitSpinUser", quotegroupFilesSoftLimitSpinUser);
|
||||||
|
builder->get_widget("quotegroupFilesHardLimitSpinUser", quotegroupFilesHardLimitSpinUser);
|
||||||
|
builder->get_widget("quotegroupSizeSoftLimitComboUser", quotegroupSizeSoftLimitComboUser);
|
||||||
|
builder->get_widget("quotegroupSizeHardLimitComboUser", quotegroupSizeHardLimitComboUser);
|
||||||
|
builder->get_widget("quotegroupFilesSoftLimitlabelUser", quotegroupFilesSoftLimitlabelUser);
|
||||||
|
builder->get_widget("quotegroupFilesHarLimitLabelUser", quotegroupFilesHarLimitLabelUser);
|
||||||
|
builder->get_widget("quotegroupSizeSoftLimitLabelUser", quotegroupSizeSoftLimitLabelUser);
|
||||||
|
builder->get_widget("quotegroupFilesSoftLimitLabelUser", quotegroupFilesSoftLimitLabelUser);
|
||||||
|
builder->get_widget("quotegroupSizeCurrentlyLabelUser", quotegroupSizeCurrentlyLabelUser);
|
||||||
|
builder->get_widget("quotegroupFilesCurrentlyLabelUser", quotegroupFilesCurrentlyLabelUser);
|
||||||
|
builder->get_widget("quotegroupSizeFrameLabelUser", quotegroupSizeFrameLabelUser);
|
||||||
|
builder->get_widget("quotegroupFilesFrameLabelUser", quotegroupFilesFrameLabelUser);
|
||||||
|
builder->get_widget("lblSetDeviceUser", lblSetDeviceUser);
|
||||||
|
builder->get_widget("lblQuotasStatusUser", lblQuotasStatusUser);
|
||||||
|
builder->get_widget("lblSetUGPUser", lblSetUGPUser);
|
||||||
|
builder->get_widget("lblSetNameDeviceUser", lblSetNameDeviceUser);
|
||||||
|
builder->get_widget("lblSetQuotasStatusUser", lblSetQuotasStatusUser);
|
||||||
|
builder->get_widget("lblSetUGPUserValue", lblSetUGPUserValue);
|
||||||
|
builder->get_widget("lblHeadQuotasEditWindowUser", lblHeadQuotasEditWindowUser);
|
||||||
|
builder->get_widget("quoteSizeHardLimitLabel1", quoteSizeHardLimitLabel1);
|
||||||
|
builder->get_widget("quoteFilesHardLimitLabelUser", quoteFilesHardLimitLabelUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::lacalization() {
|
||||||
|
lblSetDeviceUser->set_text(str_device);
|
||||||
|
lblQuotasStatusUser->set_text(str_quota_status);
|
||||||
|
quotegroupSizeFrameLabelUser->set_text(str_size);
|
||||||
|
quotegroupFilesFrameLabelUser->set_text(str_files);
|
||||||
|
quotegroupSizeCurrentlyLabelUser->set_text(str_currently_using);
|
||||||
|
quotegroupSizeSoftLimitLabelUser->set_text(str_soft_limit);
|
||||||
|
quoteSizeHardLimitLabel1->set_text(str_hard_limit);
|
||||||
|
quoteFilesHardLimitLabelUser->set_text(str_hard_limit);
|
||||||
|
quotegroupFilesSoftLimitLabelUser->set_text(str_soft_limit);
|
||||||
|
quotegroupFilesCurrentlyLabelUser->set_text(str_currently_using);
|
||||||
|
this->fill_in_pow_memory(quotegroupSizeSoftLimitComboUser);
|
||||||
|
this->fill_in_pow_memory(quotegroupSizeHardLimitComboUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void View_edit_user_group::check_limit(Gtk::CheckButton *check_button, Gtk::SpinButton *spin, Gtk::ComboBoxText *combo_box) {
|
||||||
|
spin->set_sensitive(check_button->get_active());
|
||||||
|
combo_box->set_sensitive(check_button->get_active());
|
||||||
|
}
|
||||||
|
void View_edit_user_group::check_limit(Gtk::CheckButton *check_button, Gtk::SpinButton *spin, Gtk::Label *combo_box) {
|
||||||
|
spin->set_sensitive(check_button->get_active());
|
||||||
|
combo_box->set_sensitive(check_button->get_active());
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::fill_in_pow_memory(Gtk::ComboBoxText *cb_text) {
|
||||||
|
cb_text->append(str_prefix_KB);
|
||||||
|
cb_text->append(str_prefix_MB);
|
||||||
|
cb_text->append(str_prefix_GB);
|
||||||
|
cb_text->append(str_prefix_TB);
|
||||||
|
}
|
||||||
|
|
||||||
|
void View_edit_user_group::set_label_type_quota(string name) {
|
||||||
|
lblSetUGPUser->set_text(name);
|
||||||
|
}
|
||||||
|
void View_edit_user_group::show() {
|
||||||
|
wndQuotasEditUser->show();
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
#ifndef VIEW_ADD_USER_GROUP_H
|
||||||
|
#define VIEW_ADD_USER_GROUP_H
|
||||||
|
#include "../project_lib.h"
|
||||||
|
#include "../var.h"
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
class View_edit_user_group
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
Glib::RefPtr<Gtk::Builder> builder;
|
||||||
|
private:
|
||||||
|
Gtk::Window* wndQuotasEditUser;
|
||||||
|
Gtk::Button* btnCancelEditUser;
|
||||||
|
Gtk::Button* btnSaveEditUser;
|
||||||
|
Gtk::CheckButton* quotegroupSizeSoftLimitCheckUser;
|
||||||
|
Gtk::CheckButton* quotegroupSizeHardLimitCheckUser;
|
||||||
|
Gtk::CheckButton* quotegroupFilesSoftLimitCheckUser;
|
||||||
|
Gtk::CheckButton* quotegroupFilesHardLimitCheckUser;
|
||||||
|
Gtk::SpinButton* quotegroupSizeSoftLimitSpinUser;
|
||||||
|
Gtk::SpinButton* quotegroupSizeHardLimitSpinUser;
|
||||||
|
Gtk::SpinButton* quotegroupFilesSoftLimitSpinUser;
|
||||||
|
Gtk::SpinButton* quotegroupFilesHardLimitSpinUser;
|
||||||
|
Gtk::ComboBoxText* quotegroupSizeSoftLimitComboUser;
|
||||||
|
Gtk::ComboBoxText* quotegroupSizeHardLimitComboUser;
|
||||||
|
Gtk::Label* quotegroupFilesSoftLimitlabelUser;
|
||||||
|
Gtk::Label* quotegroupFilesHarLimitLabelUser;
|
||||||
|
Gtk::Label* quotegroupSizeSoftLimitLabelUser;
|
||||||
|
Gtk::Label* quotegroupFilesSoftLimitLabelUser;
|
||||||
|
Gtk::Label* quotegroupSizeCurrentlyLabelUser;
|
||||||
|
Gtk::Label* quotegroupFilesCurrentlyLabelUser;
|
||||||
|
Gtk::Label* quotegroupSizeFrameLabelUser;
|
||||||
|
Gtk::Label* quotegroupFilesFrameLabelUser;
|
||||||
|
Gtk::Label* lblSetDeviceUser;
|
||||||
|
Gtk::Label* lblQuotasStatusUser;
|
||||||
|
Gtk::Label* lblSetUGPUser;
|
||||||
|
Gtk::Label* lblSetNameDeviceUser;
|
||||||
|
Gtk::Label* lblSetQuotasStatusUser;
|
||||||
|
Gtk::Label* lblSetUGPUserValue;
|
||||||
|
Gtk::Label* lblHeadQuotasEditWindowUser;
|
||||||
|
Gtk::Label* quoteSizeHardLimitLabel1;
|
||||||
|
Gtk::Label* quoteFilesHardLimitLabelUser;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
View_edit_user_group(/* args */);
|
||||||
|
~View_edit_user_group();
|
||||||
|
void setting();
|
||||||
|
void event();
|
||||||
|
void show();
|
||||||
|
void get_builder();
|
||||||
|
void check_limit(Gtk::CheckButton *check_button, Gtk::SpinButton *spin, Gtk::ComboBoxText *combo_box);
|
||||||
|
void check_limit(Gtk::CheckButton *check_button, Gtk::SpinButton *spin, Gtk::Label *combo_box);
|
||||||
|
void fill_in_pow_memory(Gtk::ComboBoxText *cb_text);
|
||||||
|
void set_label_type_quota(string name);
|
||||||
|
void lacalization();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue