Добавлен CSS

pull/1/head
Igor Belitskiy 3 years ago
parent 26593a42db
commit e912ffe356

@ -104,9 +104,9 @@ install: check uninstall
@install -Dm755 -t /usr/bin/ ${CMAKE_BUILD_DIR}/${PKGNAME}
@install -Dm644 -t /usr/share/applications/ ${PKGNAME}.desktop
@install -Dm644 -t /usr/share/polkit-1/actions/ org.ublinux.pkexec.${PKGNAME}.exec.policy
@install -dm755 /usr/share/${PKGNAME}/{ui,images}
@install -dm755 /usr/share/${PKGNAME}/{ui,css,images}
@install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}.glade
# @install -Dm644 -t /usr/share/${PKGNAME}/css/ style.css
@install -Dm644 -t /usr/share/${PKGNAME}/css/ style.css
# @install -Dm644 -t /usr/share/${PKGNAME}/images/ ${PKGNAME}.svg
# @install -Dm644 -t /usr/share/${PKGNAME}/images/ ${PKGNAME}.png
@gtk-update-icon-cache -fiq /usr/share/icons/hicolor/

@ -1,2 +1,28 @@
# ublexec
# ВЫполнить
# Build
In order to build ublexec you will need:
- CMake
- C compiler
- GTK+ 3 & dependencies
Once you have all the necessary dependencies, you can use:
```sh
$ make
```
# Installation
After a successful build, just use:
```sh
$ sudo make install clean
```
# Uninstallation
After a successful build, just use:
```sh
$ sudo make uninstall
```
![alt text](screenshot/screenshot.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

@ -34,6 +34,7 @@ using namespace std;
string path_app= "/usr/bin/";
string path_glade= "/usr/share/ublexec/ui/ublexec.glade";
string path_css = "/usr/share/ublexec/css/style.css";
//string path_app = "/home/superadmin/Документы/Проект/ubconfig_new/ubcall/";
string app_name = "ublexec";
CmdArgParser::CmdArgParser(const std::string& p_name, const std::string& p_description, const std::string& p_help)
@ -70,7 +71,7 @@ void MainWindow::get_builder(){
builder->get_widget("rbSu", rbSu);
builder->get_widget("rbSudo", rbSudo);
builder->get_widget("txtCmd", txtCmd);
builder->get_widget("wndChooseDirWallpaper", wndChooseDirWallpaper);
builder->get_widget("wndChooseFileWallpaper", wndChooseFileWallpaper);
builder->get_widget("btnFilemangerExit", btnFilemangerExit);
builder->get_widget("btnFilemangerOk", btnFilemangerOk);
builder->get_widget("lblTimeEpriorityLow", lblTimeEpriorityLow);
@ -85,7 +86,6 @@ void MainWindow::get_builder(){
builder->get_widget("btnStartMenuOK", btnStartMenuOK);
builder->get_widget("btnStartMenuExit", btnStartMenuExit);
builder->get_widget("boxlistProgramm", boxlistProgramm);
builder->get_widget("lblInfoHead", lblInfoHead);
builder->get_widget("lblinfoCmd", lblinfoCmd);
builder->get_widget("lblInfoTime", lblInfoTime);
@ -97,9 +97,23 @@ void MainWindow::get_builder(){
builder->get_widget("lblInfoExec", lblInfoExec);
builder->get_widget("lblInfoPriority", lblInfoPriority);
builder->get_widget("lblInfoPriority", lblInfoEnterProg);
builder->get_widget("boxColor", boxColor);
}
void MainWindow::add_CSS(){
Glib::RefPtr<Gtk::CssProvider> cssProvider = Gtk::CssProvider::create();
cssProvider->load_from_path(path_css);
Glib::RefPtr<Gtk::StyleContext> styleContext = Gtk::StyleContext::create();
Glib::RefPtr<Gdk::Screen> screen = Gdk::Screen::get_default();//get default screen
styleContext->add_provider_for_screen(screen, cssProvider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);//add provider for screen in all application
Glib::RefPtr<Gtk::StyleContext> context = boxColor->get_style_context();
context->add_class("cssboxColor1");
}
void MainWindow::localization(){
this->set_title(gettext("ublexec"));
btnStart->set_label(gettext("Run"));
wndChooseFileWallpaper->set_title(gettext("Please select File"));
dialogStartMenu->set_title(gettext("Warning!"));
lblInfoHead->set_text(gettext("Running applications as a user with a specified priority"));
lblinfoCmd->set_text(gettext("Command Line"));
@ -113,7 +127,7 @@ void MainWindow::localization(){
lblInfoPriority->set_text(gettext("Priority:"));
lblMessageError->set_text(gettext("Select an executable file or program"));
lblInfoEnterProg->set_text(gettext("Selecting Programs"));
btnStart->set_label(gettext("Run"));
}
void MainWindow::event(){
@ -138,6 +152,7 @@ void MainWindow::settings(){
this->get_builder();
this->event();
this->localization();
this->add_CSS();
spinPriority->set_range(-20,19);
spinPriority->set_increments(1.0,-1.0);
scalePriority->set_inverted(true);
@ -167,13 +182,13 @@ void MainWindow::activ_or_block_execute_epriority(){
}
void MainWindow::open_filemaneg(){
wndChooseDirWallpaper->show();
wndChooseFileWallpaper->show();
}
void MainWindow::close_filemaneg(){
wndChooseDirWallpaper->hide();
wndChooseFileWallpaper->hide();
}
void MainWindow::get_path_filemaneg(){
path_file_name = wndChooseDirWallpaper->get_filename();
path_file_name = wndChooseFileWallpaper->get_filename();
if (path_file_name.length()==0){}
else{
this->close_filemaneg();
@ -265,9 +280,6 @@ void MainWindow::start_cmd(){
}
txtCmd->set_text(str_cmd_terminal + str_variants_root + str_nice_cmd);
path_file_name="";
}
void MainWindow::changed_user(){

@ -34,6 +34,7 @@ using namespace std;
extern string path_app;
extern string app_name;
extern string path_glade;
extern string path_css;
class CmdArgParser : public Glib::OptionGroup
@ -62,6 +63,7 @@ public:
MainWindow(BaseObjectType* obj, Glib::RefPtr<Gtk::Builder> const& builder);
MainWindow(Glib::RefPtr<Gtk::Builder> const& builder);
void get_builder();
void add_CSS();
void localization();
void event();
void settings();
@ -99,7 +101,7 @@ public:
Gtk::RadioButton *rbSu;
Gtk::RadioButton *rbSudo;
Gtk::Entry *txtCmd;
Gtk::FileChooserDialog *wndChooseDirWallpaper;
Gtk::FileChooserDialog *wndChooseFileWallpaper;
Gtk::Button *btnFilemangerExit;
Gtk::Button *btnFilemangerOk;
Gtk::Label *lblTimeEpriority;
@ -124,6 +126,7 @@ public:
Gtk::Label *lblInfoExec;
Gtk::Label *lblInfoPriority;
Gtk::Label *lblInfoEnterProg;
Gtk::Box *boxColor;

@ -0,0 +1,4 @@
.cssboxColor1{
background-color: rgb(255, 255, 255);
background-size: 100% auto;
}

@ -122,6 +122,7 @@
</object>
<object class="GtkWindow" id="window">
<property name="can-focus">False</property>
<property name="title" translatable="yes">Выполнить</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@ -138,7 +139,7 @@
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<object class="GtkBox" id="boxColor">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
@ -171,6 +172,9 @@
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="label" translatable="yes">Запуск приложений от имени пользователя с указанным приоритетом</property>
<attributes>
<attribute name="size" value="12288"/>
</attributes>
</object>
<packing>
<property name="expand">True</property>
@ -264,8 +268,8 @@
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="margin-top">3</property>
<property name="margin-bottom">3</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@ -963,9 +967,9 @@
</object>
</child>
</object>
<object class="GtkFileChooserDialog" id="wndChooseDirWallpaper">
<object class="GtkFileChooserDialog" id="wndChooseFileWallpaper">
<property name="can-focus">False</property>
<property name="title" translatable="yes">Пожалуйста Выберите Файл</property>
<property name="title" translatable="yes">Пожалуйста выберите Файл</property>
<property name="modal">True</property>
<property name="window-position">center</property>
<property name="default-width">500</property>

@ -67,7 +67,7 @@ msgid "Select an executable file or program"
msgstr "Выберите исполняемый файл или программу"
msgid "Please select File"
msgstr "Пожалуйста Выберите Файл"
msgstr "Пожалуйста выберите Файл"
msgid "Warning!"
msgstr "Внимание!"

Loading…
Cancel
Save