Start of warning and error parsing.
This commit is contained in:
parent
b3dd4d6a08
commit
75a9d5aa98
10 changed files with 232 additions and 67 deletions
|
@ -2,5 +2,9 @@
|
||||||
# GitIgnore for JoeyDev Projects
|
# GitIgnore for JoeyDev Projects
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# No build results.
|
||||||
|
results/
|
||||||
|
build.tar.bz2
|
||||||
|
|
||||||
# No baked data.
|
# No baked data.
|
||||||
*.dat
|
*.dat
|
||||||
|
|
|
@ -64,7 +64,7 @@ typedef struct ArchiveS {
|
||||||
extern char __utilFilenameBuffer[FILENAME_MAX];
|
extern char __utilFilenameBuffer[FILENAME_MAX];
|
||||||
|
|
||||||
|
|
||||||
void utilAddTextToListBox(GtkListBox *list, char *text);
|
void utilAddTextToListBox(GtkListBox *list, char *text, gboolean markup);
|
||||||
void utilClearContainer(GtkContainer *container);
|
void utilClearContainer(GtkContainer *container);
|
||||||
char *utilCreateString(char *format, ...);
|
char *utilCreateString(char *format, ...);
|
||||||
char *utilCreateStringVArgs(char *format, va_list args);
|
char *utilCreateStringVArgs(char *format, va_list args);
|
||||||
|
@ -77,6 +77,7 @@ void utilExtractResource(char *path);
|
||||||
char *utilFileBasename(char *path);
|
char *utilFileBasename(char *path);
|
||||||
gboolean utilFileCopy(char *from, char *to);
|
gboolean utilFileCopy(char *from, char *to);
|
||||||
gboolean utilFileExists(char *filename);
|
gboolean utilFileExists(char *filename);
|
||||||
|
ssize_t utilGetLine(char **lineptr, size_t *n, FILE *stream);
|
||||||
gboolean utilFileOpen(WindowDataT *self, char *extension, char *what);
|
gboolean utilFileOpen(WindowDataT *self, char *extension, char *what);
|
||||||
char *utilFilePath(char *filename);
|
char *utilFilePath(char *filename);
|
||||||
char *utilFileRemoveExtension(char *filename);
|
char *utilFileRemoveExtension(char *filename);
|
||||||
|
|
|
@ -182,7 +182,7 @@ static void loadEditor(EditorDataT *self) {
|
||||||
in = fopen(self->windowData.filename, "rt");
|
in = fopen(self->windowData.filename, "rt");
|
||||||
if (in != NULL) {
|
if (in != NULL) {
|
||||||
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 1024); // Not technically needed, but fixes a pointer warning from memmaker.
|
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 1024); // Not technically needed, but fixes a pointer warning from memmaker.
|
||||||
while (getline(&line, &len, in) != -1) {
|
while (utilGetLine(&line, &len, in) != -1) {
|
||||||
SSM(SCI_ADDTEXT, strlen(line), (sptr_t)line);
|
SSM(SCI_ADDTEXT, strlen(line), (sptr_t)line);
|
||||||
}
|
}
|
||||||
fclose(in);
|
fclose(in);
|
||||||
|
@ -218,7 +218,7 @@ static void loadEditorConfig(char *lexer, EditorDataT *self) {
|
||||||
if (in) {
|
if (in) {
|
||||||
// Load config.
|
// Load config.
|
||||||
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 4096); // Not technically needed, but fixes a pointer warning from memmaker.
|
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 4096); // Not technically needed, but fixes a pointer warning from memmaker.
|
||||||
while (getline(&line, &len, in) != -1) {
|
while (utilGetLine(&line, &len, in) != -1) {
|
||||||
if (strlen(line) > 0) line[strlen(line) - 1] = 0;
|
if (strlen(line) > 0) line[strlen(line) - 1] = 0;
|
||||||
c = utilGetToken(line, " ", "\"", "\"");
|
c = utilGetToken(line, " ", "\"", "\"");
|
||||||
utilDequote(c);
|
utilDequote(c);
|
||||||
|
|
|
@ -163,7 +163,7 @@ static gboolean messagesUpdate(gpointer userData) {
|
||||||
gtk_widget_show_all(_self->window);
|
gtk_widget_show_all(_self->window);
|
||||||
}
|
}
|
||||||
|
|
||||||
utilAddTextToListBox(GTK_LIST_BOX(_lstMessages), string);
|
utilAddTextToListBox(GTK_LIST_BOX(_lstMessages), string, TRUE);
|
||||||
utilForceUpdate();
|
utilForceUpdate();
|
||||||
|
|
||||||
// Scroll to show new row.
|
// Scroll to show new row.
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "http.h"
|
#include "http.h"
|
||||||
#include "ssh.h"
|
#include "ssh.h"
|
||||||
|
|
||||||
#include "messages.h"
|
#include "messages.h"
|
||||||
#include "compiler.h"
|
#include "compiler.h"
|
||||||
#include "editor.h"
|
#include "editor.h"
|
||||||
|
@ -111,6 +112,7 @@ EVENT void menuProjectProjectRemove(GtkWidget *object, gpointer userDat
|
||||||
EVENT void menuProjectProjectProperties(GtkWidget *object, gpointer userData);
|
EVENT void menuProjectProjectProperties(GtkWidget *object, gpointer userData);
|
||||||
EVENT void menuProjectBuildSettings(GtkWidget *object, gpointer userData);
|
EVENT void menuProjectBuildSettings(GtkWidget *object, gpointer userData);
|
||||||
EVENT void menuProjectBuildTargets(GtkWidget *object, gpointer userData);
|
EVENT void menuProjectBuildTargets(GtkWidget *object, gpointer userData);
|
||||||
|
EVENT void menuProjectBuildLastResults(GtkWidget *object, gpointer userData);
|
||||||
EVENT void menuProjectBuildCookRecipes(GtkWidget *object, gpointer userData);
|
EVENT void menuProjectBuildCookRecipes(GtkWidget *object, gpointer userData);
|
||||||
EVENT void menuProjectBuildBuild(GtkWidget *object, gpointer userData);
|
EVENT void menuProjectBuildBuild(GtkWidget *object, gpointer userData);
|
||||||
EVENT void menuProjectHelpProject(GtkWidget *object, gpointer userData);
|
EVENT void menuProjectHelpProject(GtkWidget *object, gpointer userData);
|
||||||
|
@ -267,12 +269,6 @@ static void cookFinished(CompilerContextT **context) {
|
||||||
|
|
||||||
static void decompressBuild(ArchiveT *archive) {
|
static void decompressBuild(ArchiveT *archive) {
|
||||||
ProjectDataT *self = (ProjectDataT *)archive->userData;
|
ProjectDataT *self = (ProjectDataT *)archive->userData;
|
||||||
char *temp;
|
|
||||||
|
|
||||||
// Delete archive.
|
|
||||||
temp = utilCreateString("%s%s", self->windowData.path, LOCAL_BUILD_RESULTS);
|
|
||||||
unlink(temp);
|
|
||||||
DEL(temp);
|
|
||||||
|
|
||||||
message(MSG_INFO, "Processing build results");
|
message(MSG_INFO, "Processing build results");
|
||||||
winBuildResultsCreate(self);
|
winBuildResultsCreate(self);
|
||||||
|
@ -374,7 +370,7 @@ static void loadConfig(ProjectDataT *self) {
|
||||||
in = fopen(self->configName, "rt");
|
in = fopen(self->configName, "rt");
|
||||||
if (in != NULL) {
|
if (in != NULL) {
|
||||||
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 1024); // Not technically needed, but fixes a pointer warning from memmaker.
|
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 1024); // Not technically needed, but fixes a pointer warning from memmaker.
|
||||||
while (getline(&line, &len, in) != -1) {
|
while (utilGetLine(&line, &len, in) != -1) {
|
||||||
if (strlen(line) > 0) line[strlen(line) - 1] = 0;
|
if (strlen(line) > 0) line[strlen(line) - 1] = 0;
|
||||||
switch (count) {
|
switch (count) {
|
||||||
case 0: // Version Number
|
case 0: // Version Number
|
||||||
|
@ -451,7 +447,7 @@ static void loadProject(ProjectDataT *self) {
|
||||||
}
|
}
|
||||||
// Load project.
|
// Load project.
|
||||||
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 1024); // Not technically needed, but fixes a pointer warning from memmaker.
|
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 1024); // Not technically needed, but fixes a pointer warning from memmaker.
|
||||||
while (getline(&line, &len, in) != -1) {
|
while (utilGetLine(&line, &len, in) != -1) {
|
||||||
if (strlen(line) > 0) line[strlen(line) - 1] = 0;
|
if (strlen(line) > 0) line[strlen(line) - 1] = 0;
|
||||||
c = utilGetToken(line, " ", "\"", "\"");
|
c = utilGetToken(line, " ", "\"", "\"");
|
||||||
utilDequote(c);
|
utilDequote(c);
|
||||||
|
@ -835,6 +831,15 @@ EVENT void menuProjectProjectProperties(GtkWidget *object, gpointer userData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
EVENT void menuProjectBuildLastResults(GtkWidget *object, gpointer userData) {
|
||||||
|
ProjectDataT *self = (ProjectDataT *)userData;
|
||||||
|
|
||||||
|
(void)object;
|
||||||
|
|
||||||
|
winBuildResultsCreate(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
EVENT void menuProjectBuildSettings(GtkWidget *object, gpointer userData) {
|
EVENT void menuProjectBuildSettings(GtkWidget *object, gpointer userData) {
|
||||||
ProjectDataT *self = (ProjectDataT *)userData;
|
ProjectDataT *self = (ProjectDataT *)userData;
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
|
@ -1313,7 +1318,7 @@ static gboolean updateBuildOptions(ProjectDataT *self) {
|
||||||
in = fopen(name, "rt");
|
in = fopen(name, "rt");
|
||||||
if (in != NULL) {
|
if (in != NULL) {
|
||||||
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 1024); // Not technically needed, but fixes a pointer warning from memmaker.
|
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 1024); // Not technically needed, but fixes a pointer warning from memmaker.
|
||||||
while (getline(&line, &len, in) != -1) {
|
while (utilGetLine(&line, &len, in) != -1) {
|
||||||
if (strlen(line) > 0) line[strlen(line) - 1] = 0;
|
if (strlen(line) > 0) line[strlen(line) - 1] = 0;
|
||||||
c = utilGetToken(line, " ", "\"", "\"");
|
c = utilGetToken(line, " ", "\"", "\"");
|
||||||
utilDequote(c);
|
utilDequote(c);
|
||||||
|
|
135
src/results.c
135
src/results.c
|
@ -20,6 +20,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "cert-err34-c" // atoi warnings
|
||||||
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "results.h"
|
#include "results.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
@ -32,8 +36,8 @@ typedef struct ResultsDataS {
|
||||||
GtkWidget *notebookResults;
|
GtkWidget *notebookResults;
|
||||||
GtkWidget *lstDebug;
|
GtkWidget *lstDebug;
|
||||||
GtkWidget *lstRelease;
|
GtkWidget *lstRelease;
|
||||||
GtkWidget *lstRaw;
|
GtkWidget *lstRawDebug;
|
||||||
int lastSelected;
|
GtkWidget *lstRawRelease;
|
||||||
} ResultsDataT;
|
} ResultsDataT;
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,7 +45,8 @@ static ResultsDataT **_resultWindows = NULL;
|
||||||
|
|
||||||
|
|
||||||
EVENT void resultClicked(GtkButton *widget, gpointer userData);
|
EVENT void resultClicked(GtkButton *widget, gpointer userData);
|
||||||
static void resultShow(gboolean release, int target, int arch, ResultsDataT *self);
|
static void resultLoadRaw(gboolean release, int target, int arch, ResultsDataT *self);
|
||||||
|
static void resultParseRaw(gboolean release, char *line, ResultsDataT *self);
|
||||||
static void resultsUpdate(ResultsDataT *self);
|
static void resultsUpdate(ResultsDataT *self);
|
||||||
EVENT gboolean winBuildResultsClose(GtkWidget *object, gpointer userData);
|
EVENT gboolean winBuildResultsClose(GtkWidget *object, gpointer userData);
|
||||||
static void winBuildResultsDelete(gpointer userData);
|
static void winBuildResultsDelete(gpointer userData);
|
||||||
|
@ -53,56 +58,99 @@ EVENT void resultClicked(GtkButton *widget, gpointer userData) {
|
||||||
int a;
|
int a;
|
||||||
gboolean r;
|
gboolean r;
|
||||||
|
|
||||||
|
// ***TODO*** Highlight the button somehow so we know what we're viewing.
|
||||||
|
|
||||||
// Extract button info from widget name.
|
// Extract button info from widget name.
|
||||||
r = (name[0] == 'r');
|
r = (name[0] == 'r');
|
||||||
t = atoi(&name[1]);
|
t = atoi(&name[1]);
|
||||||
a = atoi(strstr(name, "a") + 1);
|
a = atoi(strstr(name, "a") + 1);
|
||||||
|
|
||||||
resultShow(r, t, a, userData);
|
resultLoadRaw(r, t, a, userData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void resultShow(gboolean release, int target, int arch, ResultsDataT *self) {
|
static void resultLoadRaw(gboolean release, int target, int arch, ResultsDataT *self) {
|
||||||
FILE *in;
|
FILE *in;
|
||||||
char *temp;
|
char *temp;
|
||||||
char *line = NULL;
|
char *line = NULL;
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
TargetT *t;
|
TargetT *t;
|
||||||
|
|
||||||
// Do we need to load new results?
|
// Clear existing contents.
|
||||||
if (target != self->lastSelected) {
|
utilClearContainer(GTK_CONTAINER(release ? self->lstRelease : self->lstDebug));
|
||||||
|
utilClearContainer(GTK_CONTAINER(release ? self->lstRawRelease : self->lstRawDebug));
|
||||||
|
|
||||||
self->lastSelected = target;
|
// Load raw output results.
|
||||||
|
t = self->project->targets[target];
|
||||||
// Clear existing contents.
|
temp = utilCreateString("%sresults%cbuild.%s.%s.%s", self->project->windowData.path, UTIL_PATH_CHAR, t->name, t->archs[arch]->name, release ? "release" : "debug");
|
||||||
utilClearContainer(GTK_CONTAINER(self->lstDebug));
|
in = fopen(temp, "rt");
|
||||||
utilClearContainer(GTK_CONTAINER(self->lstRelease));
|
if (in) {
|
||||||
utilClearContainer(GTK_CONTAINER(self->lstRaw));
|
while (!feof(in)) {
|
||||||
|
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 1024); // Not technically needed, but fixes a pointer warning from memmaker.
|
||||||
// Load raw results.
|
while (utilGetLine(&line, &len, in) != -1) {
|
||||||
t = self->project->targets[target];
|
if (strlen(line) > 0) line[strlen(line) - 1] = 0;
|
||||||
temp = utilCreateString("%sresults%cbuild.%s.%s.%s", self->project->windowData.path, UTIL_PATH_CHAR, t->name, t->archs[arch]->name, release ? "release" : "debug");
|
utilAddTextToListBox(GTK_LIST_BOX(release ? self->lstRawRelease : self->lstRawDebug), line, FALSE);
|
||||||
in = fopen(temp, "rt");
|
resultParseRaw(release, line, self);
|
||||||
if (in) {
|
|
||||||
while (!feof(in)) {
|
|
||||||
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 1024); // Not technically needed, but fixes a pointer warning from memmaker.
|
|
||||||
while (getline(&line, &len, in) != -1) {
|
|
||||||
if (strlen(line) > 0) line[strlen(line) - 1] = 0;
|
|
||||||
utilAddTextToListBox(GTK_LIST_BOX(self->lstRaw), line);
|
|
||||||
//***TODO*** Parse these for the other tabs. And, oops, we need two RAW tabs!
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fclose(in);
|
|
||||||
DEL(line);
|
|
||||||
}
|
}
|
||||||
DEL(temp);
|
fclose(in);
|
||||||
|
DEL(line);
|
||||||
}
|
}
|
||||||
|
DEL(temp);
|
||||||
|
|
||||||
// Display appropriate tab.
|
// Display appropriate tab.
|
||||||
gtk_notebook_set_current_page(GTK_NOTEBOOK(self->notebookResults), release ? 1 : 0);
|
gtk_notebook_set_current_page(GTK_NOTEBOOK(self->notebookResults), release ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void resultParseRaw(gboolean release, char *line, ResultsDataT *self) {
|
||||||
|
GtkWidget *messages;
|
||||||
|
GtkWidget *row;
|
||||||
|
GtkWidget *box;
|
||||||
|
GtkWidget *label;
|
||||||
|
GtkWidget *button;
|
||||||
|
char *temp;
|
||||||
|
char *text = NULL;
|
||||||
|
gboolean isWarning = FALSE;
|
||||||
|
|
||||||
|
messages = release ? self->lstRelease : self->lstDebug;
|
||||||
|
|
||||||
|
// ***TODO*** This is going to need to be a lot more complicated.
|
||||||
|
// We need the line number and filename from multiple compilers.
|
||||||
|
if (strstr(line, " warning: ") != NULL) {
|
||||||
|
text = line;
|
||||||
|
isWarning = TRUE;
|
||||||
|
}
|
||||||
|
if (strstr(line, " error: ") != NULL) {
|
||||||
|
text = line;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (text) {
|
||||||
|
// New listbox row.
|
||||||
|
row = gtk_list_box_row_new();
|
||||||
|
box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
|
||||||
|
gtk_widget_set_hexpand(box, TRUE);
|
||||||
|
|
||||||
|
// Icon button.
|
||||||
|
button = gtk_button_new_from_icon_name(isWarning ? "dialog-warning" : "dialog-error", GTK_ICON_SIZE_BUTTON);
|
||||||
|
temp = utilCreateString("%c", isWarning ? 'w' : 'e'); // We store data about this button in its name.
|
||||||
|
gtk_widget_set_name(button, temp);
|
||||||
|
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
|
||||||
|
DEL(temp);
|
||||||
|
|
||||||
|
// Message.
|
||||||
|
label = gtk_label_new(text);
|
||||||
|
gtk_label_set_use_markup(GTK_LABEL(label), FALSE);
|
||||||
|
gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
|
||||||
|
|
||||||
|
// Add to list.
|
||||||
|
gtk_container_add(GTK_CONTAINER(row), box);
|
||||||
|
gtk_list_box_insert(GTK_LIST_BOX(messages), row, -1);
|
||||||
|
gtk_widget_show_all(GTK_WIDGET(messages));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void resultsUpdate(ResultsDataT *self) {
|
static void resultsUpdate(ResultsDataT *self) {
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
|
@ -119,6 +167,9 @@ static void resultsUpdate(ResultsDataT *self) {
|
||||||
|
|
||||||
utilClearContainer(GTK_CONTAINER(self->gridResults));
|
utilClearContainer(GTK_CONTAINER(self->gridResults));
|
||||||
|
|
||||||
|
//***TODO*** This should probably iterate over what files exist not what we expect.
|
||||||
|
// We also need to figure out why the system list is empty some times and display an error/message.
|
||||||
|
|
||||||
// Iterate over target data and load results.
|
// Iterate over target data and load results.
|
||||||
for (i=0; i<arrlen(self->project->targets); i++) {
|
for (i=0; i<arrlen(self->project->targets); i++) {
|
||||||
t = self->project->targets[i];
|
t = self->project->targets[i];
|
||||||
|
@ -132,13 +183,13 @@ static void resultsUpdate(ResultsDataT *self) {
|
||||||
// Add to grid. Name.
|
// Add to grid. Name.
|
||||||
w = gtk_label_new(t->longName);
|
w = gtk_label_new(t->longName);
|
||||||
gtk_label_set_line_wrap(GTK_LABEL(w), FALSE);
|
gtk_label_set_line_wrap(GTK_LABEL(w), FALSE);
|
||||||
gtk_label_set_xalign(GTK_LABEL(w), 1.0);
|
gtk_label_set_xalign(GTK_LABEL(w), 1.0f);
|
||||||
gtk_grid_attach(GTK_GRID(self->gridResults), w, 0, gridLine, 1, 1);
|
gtk_grid_attach(GTK_GRID(self->gridResults), w, 0, gridLine, 1, 1);
|
||||||
|
|
||||||
// Add to grid. Arch.
|
// Add to grid. Arch.
|
||||||
w = gtk_label_new(t->archs[j]->name);
|
w = gtk_label_new(t->archs[j]->name);
|
||||||
gtk_label_set_line_wrap(GTK_LABEL(w), FALSE);
|
gtk_label_set_line_wrap(GTK_LABEL(w), FALSE);
|
||||||
gtk_label_set_xalign(GTK_LABEL(w), 1.0);
|
gtk_label_set_xalign(GTK_LABEL(w), 1.0f);
|
||||||
gtk_grid_attach(GTK_GRID(self->gridResults), w, 1, gridLine, 1, 1);
|
gtk_grid_attach(GTK_GRID(self->gridResults), w, 1, gridLine, 1, 1);
|
||||||
|
|
||||||
// See if we got binaries for debug and release.
|
// See if we got binaries for debug and release.
|
||||||
|
@ -190,7 +241,8 @@ static void resultsUpdate(ResultsDataT *self) {
|
||||||
|
|
||||||
// Did we load anything?
|
// Did we load anything?
|
||||||
if (gridLine > 0) {
|
if (gridLine > 0) {
|
||||||
resultShow(FALSE, firstSystem, 0, self);
|
resultLoadRaw(FALSE, firstSystem, 0, self);
|
||||||
|
resultLoadRaw(TRUE, firstSystem, 0, self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +266,8 @@ void winBuildResultsCreate(ProjectDataT *project) {
|
||||||
"gridBuildResults",
|
"gridBuildResults",
|
||||||
"lstBuildMessagesDebug",
|
"lstBuildMessagesDebug",
|
||||||
"lstBuildMessagesRelease",
|
"lstBuildMessagesRelease",
|
||||||
"lstBuildMessagesRaw",
|
"lstBuildOutputDebug",
|
||||||
|
"lstBuildOutputRelease",
|
||||||
"notebookResults",
|
"notebookResults",
|
||||||
NULL
|
NULL
|
||||||
};static
|
};static
|
||||||
|
@ -224,8 +277,10 @@ void winBuildResultsCreate(ProjectDataT *project) {
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
char *temp;
|
||||||
|
|
||||||
// Is there already a results window open for this project?
|
// Is there already a results window open for this project?
|
||||||
for (i=0; i<arrlen(_resultWindows); i++) {
|
for (i=0; i<arrlen(_resultWindows); i++) {
|
||||||
|
@ -241,7 +296,6 @@ void winBuildResultsCreate(ProjectDataT *project) {
|
||||||
self = NEW(ResultsDataT);
|
self = NEW(ResultsDataT);
|
||||||
self->windowData.closeWindow = winBuildResultsClose;
|
self->windowData.closeWindow = winBuildResultsClose;
|
||||||
self->project = project;
|
self->project = project;
|
||||||
self->lastSelected = -1;
|
|
||||||
project->buildResults = self;
|
project->buildResults = self;
|
||||||
|
|
||||||
// Load widgets from XML.
|
// Load widgets from XML.
|
||||||
|
@ -249,13 +303,19 @@ void winBuildResultsCreate(ProjectDataT *project) {
|
||||||
widgets[1] = &self->gridResults;
|
widgets[1] = &self->gridResults;
|
||||||
widgets[2] = &self->lstDebug;
|
widgets[2] = &self->lstDebug;
|
||||||
widgets[3] = &self->lstRelease;
|
widgets[3] = &self->lstRelease;
|
||||||
widgets[4] = &self->lstRaw;
|
widgets[4] = &self->lstRawDebug;
|
||||||
widgets[5] = &self->notebookResults;
|
widgets[5] = &self->lstRawRelease;
|
||||||
|
widgets[6] = &self->notebookResults;
|
||||||
utilGetWidgetsFromMemory("/com/kangaroopunch/joeydev/BuildResults.glade", widgetNames, widgets, self);
|
utilGetWidgetsFromMemory("/com/kangaroopunch/joeydev/BuildResults.glade", widgetNames, widgets, self);
|
||||||
|
|
||||||
// Register window.
|
// Register window.
|
||||||
utilWindowRegister(self);
|
utilWindowRegister(self);
|
||||||
|
|
||||||
|
// Adjust title.
|
||||||
|
temp = utilCreateString("%s - %s", self->windowData.title, self->project->projectName);
|
||||||
|
gtk_window_set_title(GTK_WINDOW(self->windowData.window), temp);
|
||||||
|
DEL(temp);
|
||||||
|
|
||||||
// Draw contents.
|
// Draw contents.
|
||||||
resultsUpdate(self);
|
resultsUpdate(self);
|
||||||
|
|
||||||
|
@ -283,3 +343,6 @@ static void winBuildResultsDelete(gpointer userData) {
|
||||||
|
|
||||||
DEL(userData);
|
DEL(userData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
58
src/utils.c
58
src/utils.c
|
@ -50,7 +50,7 @@ char __utilFilenameBuffer[FILENAME_MAX];
|
||||||
gboolean utilDecompressUpdate(gpointer userData); // Not static
|
gboolean utilDecompressUpdate(gpointer userData); // Not static
|
||||||
|
|
||||||
|
|
||||||
void utilAddTextToListBox(GtkListBox *list, char *text) {
|
void utilAddTextToListBox(GtkListBox *list, char *text, gboolean markup) {
|
||||||
GtkWidget *row;
|
GtkWidget *row;
|
||||||
GtkWidget *box;
|
GtkWidget *box;
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
|
@ -59,13 +59,13 @@ void utilAddTextToListBox(GtkListBox *list, char *text) {
|
||||||
box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
|
box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
|
||||||
gtk_widget_set_hexpand(box, TRUE);
|
gtk_widget_set_hexpand(box, TRUE);
|
||||||
label = gtk_label_new(text);
|
label = gtk_label_new(text);
|
||||||
gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
|
gtk_label_set_use_markup(GTK_LABEL(label), markup);
|
||||||
|
|
||||||
// Add new row to the message box.
|
// Add new row to the message box.
|
||||||
gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
|
gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
|
||||||
gtk_container_add(GTK_CONTAINER(row), box);
|
gtk_container_add(GTK_CONTAINER(row), box);
|
||||||
gtk_list_box_insert(GTK_LIST_BOX(list), row, -1);
|
gtk_list_box_insert(GTK_LIST_BOX(list), row, -1);
|
||||||
gtk_widget_show_all(list);
|
gtk_widget_show_all(GTK_WIDGET(list));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -462,6 +462,58 @@ gboolean utilFileExists(char *filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ssize_t utilGetLine(char **lineptr, size_t *n, FILE *stream) {
|
||||||
|
size_t pos;
|
||||||
|
int c;
|
||||||
|
|
||||||
|
/* The original code is public domain -- Will Hartung 4/9/09 */
|
||||||
|
/* Modifications, public domain as well, by Antti Haapala, 11/10/17
|
||||||
|
- Switched to getc on 5/23/19 */
|
||||||
|
|
||||||
|
if (lineptr == NULL || stream == NULL || n == NULL) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
c = getc(stream);
|
||||||
|
if (c == EOF) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*lineptr == NULL) {
|
||||||
|
*lineptr = malloc(128);
|
||||||
|
if (*lineptr == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
*n = 128;
|
||||||
|
}
|
||||||
|
|
||||||
|
pos = 0;
|
||||||
|
while(c != EOF) {
|
||||||
|
if (pos + 1 >= *n) {
|
||||||
|
size_t new_size = *n + (*n >> 2);
|
||||||
|
if (new_size < 128) {
|
||||||
|
new_size = 128;
|
||||||
|
}
|
||||||
|
char *new_ptr = realloc(*lineptr, new_size);
|
||||||
|
if (new_ptr == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
*n = new_size;
|
||||||
|
*lineptr = new_ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
((unsigned char *)(*lineptr))[pos ++] = c;
|
||||||
|
if (c == '\n') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
c = getc(stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
(*lineptr)[pos] = '\0';
|
||||||
|
return (ssize_t)pos;
|
||||||
|
}
|
||||||
|
|
||||||
gboolean utilFileOpen(WindowDataT *self, char *extension, char *what) {
|
gboolean utilFileOpen(WindowDataT *self, char *extension, char *what) {
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
GtkFileFilter *filter;
|
GtkFileFilter *filter;
|
||||||
|
|
|
@ -640,7 +640,7 @@ static void loadVectorImage(VectorDataT *self) {
|
||||||
if (in != NULL) {
|
if (in != NULL) {
|
||||||
self->buffer[0] = 0;
|
self->buffer[0] = 0;
|
||||||
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 1024); // Not technically needed, but fixes a pointer warning from memmaker.
|
utilEnsureBufferSize((unsigned char **)&line, (int *)&len, 1024); // Not technically needed, but fixes a pointer warning from memmaker.
|
||||||
while (getline(&line, &len, in) != -1) {
|
while (utilGetLine(&line, &len, in) != -1) {
|
||||||
switch (count) {
|
switch (count) {
|
||||||
case 0: // Version Number
|
case 0: // Version Number
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -4,12 +4,9 @@
|
||||||
<requires lib="gtk+" version="3.24"/>
|
<requires lib="gtk+" version="3.24"/>
|
||||||
<object class="GtkWindow" id="winBuildResults">
|
<object class="GtkWindow" id="winBuildResults">
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="margin-start">10</property>
|
|
||||||
<property name="margin-end">10</property>
|
|
||||||
<property name="margin-top">10</property>
|
|
||||||
<property name="margin-bottom">10</property>
|
|
||||||
<property name="title" translatable="yes">Build Results</property>
|
<property name="title" translatable="yes">Build Results</property>
|
||||||
<property name="default-width">800</property>
|
<property name="default-width">800</property>
|
||||||
|
<property name="default-height">400</property>
|
||||||
<property name="icon-name">task-due</property>
|
<property name="icon-name">task-due</property>
|
||||||
<signal name="destroy" handler="winBuildResultsClose" swapped="no"/>
|
<signal name="destroy" handler="winBuildResultsClose" swapped="no"/>
|
||||||
<child>
|
<child>
|
||||||
|
@ -102,7 +99,7 @@
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="label" translatable="yes">Debug</property>
|
<property name="label" translatable="yes">Debug Messages</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="tab-fill">False</property>
|
<property name="tab-fill">False</property>
|
||||||
|
@ -134,7 +131,7 @@
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="label" translatable="yes">Release</property>
|
<property name="label" translatable="yes">Release Messages</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="position">1</property>
|
<property name="position">1</property>
|
||||||
|
@ -151,7 +148,7 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkListBox" id="lstBuildMessagesRaw">
|
<object class="GtkListBox" id="lstBuildOutputDebug">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
</object>
|
</object>
|
||||||
|
@ -167,13 +164,46 @@
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="label" translatable="yes">Raw</property>
|
<property name="label" translatable="yes">Debug Output</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="position">2</property>
|
<property name="position">2</property>
|
||||||
<property name="tab-fill">False</property>
|
<property name="tab-fill">False</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="shadow-type">in</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkViewport">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkListBox" id="lstBuildOutputRelease">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child type="tab">
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Release Output</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="position">3</property>
|
||||||
|
<property name="tab-fill">False</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">True</property>
|
<property name="expand">True</property>
|
||||||
|
|
|
@ -170,6 +170,22 @@
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="menuProjectBuildLastResults">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Last Build Results...</property>
|
||||||
|
<property name="use-underline">True</property>
|
||||||
|
<signal name="activate" handler="menuProjectBuildLastResults" swapped="no"/>
|
||||||
|
<accelerator key="l" signal="activate" modifiers="GDK_CONTROL_MASK"/>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSeparatorMenuItem">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuItem" id="menuProjectBuildCookRecipes">
|
<object class="GtkMenuItem" id="menuProjectBuildCookRecipes">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
@ -180,12 +196,6 @@
|
||||||
<accelerator key="r" signal="activate" modifiers="GDK_CONTROL_MASK"/>
|
<accelerator key="r" signal="activate" modifiers="GDK_CONTROL_MASK"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkSeparatorMenuItem">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can-focus">False</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuItem" id="menuProjectBuildBuild">
|
<object class="GtkMenuItem" id="menuProjectBuildBuild">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
|
Loading…
Add table
Reference in a new issue