Merge pull request 'master' (#51) from YanTheKaller/ublexec:master into master
Reviewed-on: #51master v2.30
commit
6a68a8f9df
@ -1,7 +1,12 @@
|
||||
ublexec.glade~
|
||||
#ublexec.glade#
|
||||
*~*
|
||||
*#*
|
||||
test.cpp
|
||||
.vscode
|
||||
ublexec
|
||||
nohup.out
|
||||
ublexec_ru.po~
|
||||
compile/
|
||||
.BUILD.md
|
||||
.install.sh
|
||||
terminal-commands/
|
||||
.updatebuild.sh
|
||||
@ -1,51 +0,0 @@
|
||||
#include "ublexec.h"
|
||||
|
||||
void pars_flag(int index_start, int argc, char* argv[]);
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
string str_argv= "";
|
||||
string str_cmd_argv = "";
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
bindtextdomain(app_name, "/usr/share/locale/");
|
||||
bind_textdomain_codeset(app_name, "UTF-8");
|
||||
textdomain(app_name);
|
||||
if (argc > 1){
|
||||
str_argv = argv[1];
|
||||
}
|
||||
if (argc == 3) {
|
||||
name_app_cmd = argv[2];
|
||||
string str_flag = argv[1];
|
||||
if (str_flag == "-x") {
|
||||
flag_prog_file = 1;
|
||||
}
|
||||
else if (str_flag == "-e") {
|
||||
flag_prog_file = 2;
|
||||
}
|
||||
}
|
||||
pars_flag(1,argc, argv);
|
||||
int local_argc = 1;
|
||||
auto app = Gtk::Application::create(local_argc, argv, "org.gtkmm.example.plug");
|
||||
auto builder = Gtk::Builder::create_from_resource(path_glade);
|
||||
MainWindow* wnd = nullptr;
|
||||
builder->get_widget_derived("window", wnd);
|
||||
auto r = app->run(*wnd);
|
||||
delete wnd;
|
||||
return r;
|
||||
}
|
||||
|
||||
void pars_flag(int index_start, int argc, char* argv[]) {
|
||||
string str_argv = "";
|
||||
for (int i = index_start; i<argc; i++){
|
||||
str_argv = argv[i];
|
||||
if (str_argv == "--help" || str_argv == "-h"){
|
||||
help();
|
||||
exit(1);
|
||||
}
|
||||
else if (str_argv == "--version" || str_argv == "-v"){
|
||||
string version = string(str_version) + version_application + "\n";
|
||||
cout << version.c_str();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
#define VERSION_LABEL yon_char_unite(_("Version:")," ",version_application,"\n",NULL)
|
||||
#define HELP_LABEL yon_char_unite(_("ublexec version:")," ", version_application,"\n",_("Run as..."),"\n",_("Usage:"), " ublexec ",_("[OPTIONS]"),"\n",_("Options:"),"\n\t--help, -h\t\t\t",_("Show this help"),"\n\t--version, -V\t\t\t",_("Show package version"),"\n\t--lock-help\t\t\t",_("Lock this help menu"),"\n",NULL)
|
||||
|
||||
#define TITLE_LABEL _("Run as...")
|
||||
#define TITLE_INFO_LABEL _("Run the application as a user with a changed priority")
|
||||
|
||||
#define SUCCESS_LABEL _("Operation succeeded")
|
||||
|
||||
#define ABOUT_LABEL _("About")
|
||||
#define DOCUMENTATION_LABEL _("Documentation")
|
||||
|
||||
#define CANCEL_LABEL _("Cancel")
|
||||
#define OPEN_LABEL _("Open")
|
||||
|
||||
#define HELP_TITLE_LABEL _("Would you like to read documentation in the Web?")
|
||||
#define HELP_INFO_LABEL _("You will be redirected to documentation website, where documentation is\ntranslated and supported by community.")
|
||||
#define HELP_ALWAYS_OPEN_LABEL _("Always redirect to online documentation")
|
||||
#define OPEN_HELP_LABEL _("Open documentation")
|
||||
#define PROJECT_HOME_LABEL _("Project homepage")
|
||||
|
||||
#define GRAPHICS_LABEL _("Graphics")
|
||||
#define TOOLS_LABEL _("Tools")
|
||||
#define INTERNET_LABEL _("Internet")
|
||||
#define MULTIMEDIA_LABEL _("Multimedia")
|
||||
#define SETTINGS_LABEL _("Settings")
|
||||
#define EDUCATION_LABEL _("Education")
|
||||
#define OFFICE_LABEL _("Office")
|
||||
#define OTHER_LABEL _("Other")
|
||||
#define DEVELOPMENT_LABEL _("Development")
|
||||
#define SYSTEM_LABEL _("System")
|
||||
|
||||
#define PRIORITY_ROOT_LABEL _("-20 (High)")
|
||||
#define PRIORITY_USER_LABEL _("0 (High)")
|
||||
#define PRIORITY_LOW_LABEL _("19 (Low)")
|
||||
|
||||
#define CHOOSE_APP_OR_FILE_LABEL _("Choose application or file for running")
|
||||
|
||||
#define TERMINAL_LABEL _("Run in the terminal emulator")
|
||||
#define APP_LABEL _("File or app for running")
|
||||
#define RUN_AS_USER_LABEL _("Run as another user:")
|
||||
#define USER_NAME_LABEL _("Username:")
|
||||
#define PRIORITY_LABEL _("Priority")
|
||||
#define PRIORITY_CHECK_LABEL _("Change startup priority")
|
||||
#define PRIORITY_SCALE_LABEL _("Priority:")
|
||||
#define COMMAND_LABEL _("Command line")
|
||||
#define RUN_LABEL _("Run")
|
||||
#define EDIT_LABEL _("Edit")
|
||||
#define USER_LABEL _("User")
|
||||
|
||||
#define FILE_VIEW_LABEL _("File view")
|
||||
#define APP_VIEW_LABEL _("Applications view")
|
||||
@ -1,91 +0,0 @@
|
||||
#include "ubl-util-standard.h"
|
||||
#ifndef __cplusplus
|
||||
#ifndef UBL_GET_STANDARD_UI
|
||||
#define UBL_GET_STANDARD_UI
|
||||
|
||||
|
||||
inline returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidget, int left_plug_id, int right_plug_id){
|
||||
returnstruct *ret=(returnstruct*)malloc(sizeof(returnstruct*));
|
||||
if (left_plug_id>0&&LeftWidget){
|
||||
GtkWidget *plug=gtk_plug_new(left_plug_id);
|
||||
GtkWidget *toplug=LeftWidget;
|
||||
if (gtk_widget_get_parent(GTK_WIDGET(toplug))){
|
||||
g_object_ref(G_OBJECT(toplug));
|
||||
GtkWidget *parent=gtk_widget_get_parent(toplug);
|
||||
gtk_container_remove(GTK_CONTAINER(parent),toplug);
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
} else
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
gtk_widget_show(GTK_WIDGET(plug));
|
||||
ret->plugLeft=plug;
|
||||
}
|
||||
if (right_plug_id>0&&RightWidget){
|
||||
GtkWidget *plug=gtk_plug_new(right_plug_id);
|
||||
GtkWidget *toplug=RightWidget;
|
||||
if (gtk_widget_get_parent(GTK_WIDGET(toplug))){
|
||||
g_object_ref(G_OBJECT(toplug));
|
||||
GtkWidget *parent=gtk_widget_get_parent(toplug);
|
||||
gtk_container_remove(GTK_CONTAINER(parent),toplug);
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
} else
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
gtk_widget_show(GTK_WIDGET(plug));
|
||||
ret->plugRight=plug;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
|
||||
inline void ubl_make_plugs(Gtk::Widget *LeftWidget, Gtk::Widget *RightWidget, int left_plug_id, int right_plug_id){
|
||||
if (left_plug_id>0&&LeftWidget){
|
||||
GtkWidget *plug=gtk_plug_new(left_plug_id);
|
||||
GtkWidget *toplug=GTK_WIDGET(LeftWidget->gobj());
|
||||
{GdkScreen *screen = gtk_widget_get_screen(plug);
|
||||
gtk_widget_set_app_paintable(plug,TRUE);
|
||||
GdkVisual *colormap = gdk_screen_get_rgba_visual(screen);
|
||||
gtk_widget_set_visual(plug, colormap);}
|
||||
{GdkScreen *screen = gtk_widget_get_screen(toplug);
|
||||
gtk_widget_set_app_paintable(toplug,TRUE);
|
||||
GdkVisual *colormap = gdk_screen_get_rgba_visual(screen);
|
||||
gtk_widget_set_visual(toplug, colormap);}
|
||||
if (gtk_widget_get_parent(GTK_WIDGET(toplug))){
|
||||
g_object_ref(G_OBJECT(toplug));
|
||||
GtkWidget *parent=gtk_widget_get_parent(toplug);
|
||||
gtk_container_remove(GTK_CONTAINER(parent),toplug);
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
} else
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
gtk_widget_show(GTK_WIDGET(plug));
|
||||
gtk_style_context_add_class(gtk_widget_get_style_context(plug),"bkim");
|
||||
gtk_style_context_add_class(gtk_widget_get_style_context(toplug),"bkim");
|
||||
gtk_style_context_add_class(gtk_widget_get_style_context(plug),"primary-toolbar");
|
||||
}
|
||||
if (right_plug_id>0&&RightWidget){
|
||||
GtkWidget *plug=gtk_plug_new(right_plug_id);
|
||||
GtkWidget *toplug=GTK_WIDGET(RightWidget->gobj());
|
||||
{GdkScreen *screen = gtk_widget_get_screen(plug);
|
||||
gtk_widget_set_app_paintable(plug,TRUE);
|
||||
GdkVisual *colormap = gdk_screen_get_rgba_visual(screen);
|
||||
gtk_widget_set_visual(plug, colormap);}
|
||||
{GdkScreen *screen = gtk_widget_get_screen(toplug);
|
||||
gtk_widget_set_app_paintable(toplug,TRUE);
|
||||
GdkVisual *colormap = gdk_screen_get_rgba_visual(screen);
|
||||
gtk_widget_set_visual(toplug, colormap);}
|
||||
if (gtk_widget_get_parent(GTK_WIDGET(toplug))){
|
||||
g_object_ref(G_OBJECT(toplug));
|
||||
GtkWidget *parent=gtk_widget_get_parent(toplug);
|
||||
gtk_container_remove(GTK_CONTAINER(parent),toplug);
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
} else
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
gtk_widget_show(GTK_WIDGET(plug));
|
||||
gtk_style_context_add_class(gtk_widget_get_style_context(plug),"bkim");
|
||||
gtk_style_context_add_class(gtk_widget_get_style_context(toplug),"bkim");
|
||||
gtk_style_context_add_class(gtk_widget_get_style_context(plug),"primary-toolbar");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1,20 +0,0 @@
|
||||
#ifndef __cplusplus
|
||||
#include <gtk/gtk.h>
|
||||
#include <gtk/gtkx.h>
|
||||
|
||||
typedef struct {
|
||||
GtkWidget *plugLeft;
|
||||
GtkWidget *plugRight;
|
||||
|
||||
|
||||
} returnstruct;
|
||||
static returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidget, int left_plug_id, int right_plug_id);
|
||||
#else
|
||||
#include <gtkmm.h>
|
||||
#include <gtkmm/stock.h>
|
||||
#include <gtkmm/window.h>
|
||||
#include <gtkmm/plug.h>
|
||||
|
||||
|
||||
static void ubl_make_plugs(Gtk::Widget *LeftWidget, Gtk::Widget *RightWidget, int left_plug_id, int right_plug_id);
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.24"/>
|
||||
<object class="GtkTreeStore" id="treestore1">
|
||||
<columns>
|
||||
<!-- column-name IconName -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name Name -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name Sections -->
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
</object>
|
||||
<object class="GtkWindow" id="ApplicationsWindow">
|
||||
<property name="width-request">500</property>
|
||||
<property name="height-request">600</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">com.ublinux.ublexec</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="MainTree">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="model">treestore1</property>
|
||||
<property name="headers-visible">False</property>
|
||||
<property name="expander-column">treeviewcolumn1</property>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
|
||||
<property name="title" translatable="yes">column</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf">
|
||||
<property name="stock_size">4</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="icon-name">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="headerBar1">
|
||||
<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="lblHeaderName1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="label" translatable="yes">Applications</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="pixel-size">32</property>
|
||||
<property name="icon-name">com.ublinux.ublexec</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue