parent
e56abd5d12
commit
e808790ee5
@ -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,39 @@
|
||||
#define VERSION_LABEL yon_char_unite(_("Version:")," ",version_application,"\n",NULL)
|
||||
#define HELP_LABEL yon_char_unite(_("ublexec version:")," ", version_application,"\n",_("TEMPLATE Manager"),"\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\t--lock-save\t\t\t",_("Lock configuration saving"),"\n\t--lock-save-local\t\t",_("Lock local configration saving"),"\n\t--lock-save-global\t\t",_("Lock global configration saving"),"\n\t--lock-load-global\t\t",_("Lock global configration loading"),"\n",NULL)
|
||||
|
||||
#define TITLE_LABEL _("TEMPLATE Manager")
|
||||
#define TITLE_INFO_LABEL _("System TEMPLATE settings management")
|
||||
|
||||
#define SUCCESS_LABEL _("Operation succeeded")
|
||||
#define ROOT_WARNING_LABEL _("Warning! Application was launched without root - root-dependent actions are locked")
|
||||
|
||||
#define ABOUT_LABEL _("About")
|
||||
#define DOCUMENTATION_LABEL _("Documentation")
|
||||
|
||||
#define SAVE_LOCAL_LABEL _("Save to local configuration")
|
||||
#define SAVE_GLOBAL_LABEL _("Save to global configuration")
|
||||
#define SAVE_CONFIGURATION_LABEL _("Save configuration")
|
||||
#define SAVE_LABEL _("Save")
|
||||
|
||||
#define LOAD_LOCAL_LABEL _("Load local configuration")
|
||||
#define LOAD_GLOBAL_LABEL _("Load global configuration")
|
||||
#define LOAD_LABEL _("Load")
|
||||
|
||||
#define CANCEL_LABEL _("Cancel")
|
||||
|
||||
#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 Home Page")
|
||||
#define NOTHING_CHOSEN_LABEL _("Nothing were chosen")
|
||||
|
||||
|
||||
#define GLOBAL_LOAD_SUCCESS_LABEL _("Global configuration loading succseeded.")
|
||||
#define LOCAL_LOAD_SUCCESS_LABEL _("Local configuration loading succseeded.")
|
||||
#define LOAD_FAILED_LABEL _("Config loading failed")
|
||||
|
||||
#define GLOBAL_LOCAL_SAVE_SUCCESS_LABEL _("Local and global configuration saving succseeded.")
|
||||
#define GLOBAL_SAVE_SUCCESS_LABEL _("Global configuration saving succseeded.")
|
||||
#define LOCAL_SAVE_SUCCESS_LABEL _("Local configuration saving succseeded.")
|
||||
#define SAVE_FAILED_LABEL
|
||||
@ -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,169 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.24"/>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">process-stop-symbolic</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">emblem-ok-symbolic</property>
|
||||
</object>
|
||||
<object class="GtkTreeStore" id="treestore1">
|
||||
<columns>
|
||||
<!-- column-name icon -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name appName -->
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window">
|
||||
<property name="width-request">800</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">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-start">5</property>
|
||||
<property name="margin-end">5</property>
|
||||
<property name="margin-top">5</property>
|
||||
<property name="margin-bottom">5</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkTreeView">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="model">treestore1</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn">
|
||||
<property name="title" translatable="yes">Name</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf"/>
|
||||
<attributes>
|
||||
<attribute name="icon-name">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="image">image2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="image">image1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="headerBar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child type="title">
|
||||
<object class="GtkLabel" id="lblHeaderName">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="label" translatable="yes">Run as...</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>
|
||||
<child>
|
||||
<object class="GtkBox" id="boxAbout">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="btnSettings">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="focus-on-click">False</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<property name="popup">menu1</property>
|
||||
<property name="direction">none</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
Loading…
Reference in new issue