edi_scm: Tidying.

This commit is contained in:
Alastair Poole 2020-08-13 22:52:43 +01:00
parent a24b6e00ad
commit 3f382eccfb
3 changed files with 19 additions and 30 deletions

View File

@ -66,48 +66,36 @@ int main(int argc, char **argv)
const char *arg, *root;
Edi_Scm_Ui_Opts options;
memset(&options,0, sizeof(Edi_Scm_Ui_Opts));
ecore_init();
elm_init(argc, argv);
memset(&options, 0, sizeof(Edi_Scm_Ui_Opts));
root = NULL;
for (int i = 1; i < argc; i++)
{
arg = argv[i];
if (!strcmp("-h", arg) || !strcmp("--help", arg))
{
usage();
}
else if (!strcmp("-c", arg) || !strcmp("--commit", arg))
{
}
options.commit = EINA_TRUE;
else if (!strcmp("-l", arg) || !strcmp("--log", arg))
{
options.log = EINA_TRUE;
}
else
{
root = arg;
}
}
if (root)
{
if (!root) usage();
ecore_init();
elm_init(argc, argv);
if (!ecore_file_is_dir(root))
{
fprintf(stderr, _("Root path must be a directory\n"));
exit(1 << 0);
}
engine = edi_scm_init_path(realpath(root, NULL));
}
else
{
engine = edi_scm_init();
exit(1);
}
engine = edi_scm_init_path(realpath(root, NULL));
if (!engine)
exit(1 << 2);
exit(1 << 7);
win = _win_add(engine);
edi_scm_ui_add(win, options);

View File

@ -612,7 +612,7 @@ static Eina_Bool
_edi_scm_ui_log_fill_cb(void *data)
{
Edi_Scm_Engine *engine;
Evas_Object *entry;
Evas_Object *entry, *scr;
Eina_List *log;
char *line;
@ -666,7 +666,7 @@ _edi_scm_ui_log(Evas_Object *parent)
btn = elm_button_add(hbx);
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(btn, 0.25, EVAS_HINT_EXPAND);
evas_object_size_hint_weight_set(btn, 0.2, EVAS_HINT_EXPAND);
elm_object_text_set(btn, _("Close"));
evas_object_smart_callback_add(btn, "clicked", _edi_scm_ui_close_cb, NULL);
@ -690,7 +690,7 @@ edi_scm_ui_add(Evas_Object *parent, Edi_Scm_Ui_Opts options)
engine = edi_scm_engine_get();
if (!engine)
exit(1 << 1);
exit(1 << 7);
if (options.log)
{

View File

@ -14,6 +14,7 @@ extern "C" {
typedef struct _Edi_Scm_Ui_Opts {
Eina_Bool log;
Eina_Bool commit;
} Edi_Scm_Ui_Opts;
/**