Removed about screen with authors.txt

This commit is contained in:
David Capello 2010-03-24 17:37:16 -03:00
parent 0c54a2682c
commit c00da333d3

View File

@ -38,9 +38,6 @@ public:
protected:
void execute(Context* context);
private:
static char* read_authors_txt(const char *filename);
};
AboutCommand::AboutCommand()
@ -55,28 +52,15 @@ void AboutCommand::execute(Context* context)
JWidget box1, label1, label2, separator1;
JWidget textbox, view, separator2;
JWidget label3, label4, box2, box3, box4, button1;
char *authors_txt = read_authors_txt("AUTHORS.txt");
FramePtr window;
if (authors_txt)
window = new Frame(true, NULL);
else
window = new Frame(false, _("About ASE"));
FramePtr window(new Frame(false, _("About " PACKAGE)));
box1 = jbox_new(JI_VERTICAL);
label1 = jlabel_new("Allegro Sprite Editor - " VERSION);
label2 = jlabel_new(_("A pixel-art program"));
label1 = jlabel_new(PACKAGE " | allegro sprite editor | " VERSION);
label2 = jlabel_new(_("A pixel art program"));
separator1 = ji_separator_new(NULL, JI_HORIZONTAL);
if (authors_txt) {
view = jview_new();
textbox = jtextbox_new(authors_txt, JI_LEFT);
separator2 = ji_separator_new(NULL, JI_HORIZONTAL);
jfree(authors_txt);
}
else {
view = textbox = separator2 = NULL;
}
view = textbox = separator2 = NULL;
label3 = jlabel_new(COPYRIGHT);
label4 = jlabel_new(WEBSITE);
@ -111,44 +95,6 @@ void AboutCommand::execute(Context* context)
window->open_window_fg();
}
char* AboutCommand::read_authors_txt(const char *filename)
{
DIRS *dirs, *dir;
char *txt = NULL;
dirs = filename_in_bindir(filename);
dirs_cat_dirs(dirs, filename_in_datadir(filename));
/* search the configuration file from first to last path */
for (dir=dirs; dir && !txt; dir=dir->next) {
PRINTF("Triying opening %s\n", dir->path);
if ((dir->path) && exists(dir->path)) {
int size;
FILE *f;
#if (MAKE_VERSION(4, 2, 1) >= MAKE_VERSION(ALLEGRO_VERSION, \
ALLEGRO_SUB_VERSION, \
ALLEGRO_WIP_VERSION))
size = file_size(dir->path);
#else
size = file_size_ex(dir->path);
#endif
if (size > 0) {
f = fopen(dir->path, "r");
if (f) {
txt = (char *)jmalloc0(size+2);
fread(txt, 1, size, f);
fclose(f);
}
}
}
}
dirs_free(dirs);
return txt;
}
//////////////////////////////////////////////////////////////////////
// CommandFactory