-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Noise analysis and other features and fixes #197
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
276f903
The following patch adds the following features and fixes:
gtrentalancia 969f384
test: get rid of unites
14c12ab
ci: fix tests
dada5a3
ci: remove --notests flags
7219b52
ci: path to micro tests
db44bb6
ci: remove always failing mageia
61ddb2e
This commit makes the following improvements (thanks
gtrentalancia 8a91fde
ci: remove always failing mageia
gtrentalancia 62148a8
Merge 969f384493d2e9111df7c921f500584b60c53dfe from drahnr/oregano
gtrentalancia 8dd76c5
The following patch adds the following features and fixes:
gtrentalancia 3e8a791
This commit makes the following improvements (thanks
gtrentalancia d0436a3
Merge branch 'master' of https://github.com/gtrentalancia/oregano
gtrentalancia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ Ricardo Markiewicz <[email protected]> | |
Andrés de Barbará <[email protected]> | ||
Marc Lorber <[email protected]> | ||
Bernhard Schuster <[email protected]> | ||
Guido Trentalancia <[email protected]> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,15 @@ | |
* Andres de Barbara <[email protected]> | ||
* Marc Lorber <[email protected]> | ||
* Bernhard Schuster <[email protected]> | ||
* Guido Trentalancia <[email protected]> | ||
* | ||
* Web page: https://ahoi.io/project/oregano | ||
* | ||
* Copyright (C) 1999-2001 Richard Hult | ||
* Copyright (C) 2003,2006 Ricardo Markiewicz | ||
* Copyright (C) 2009-2012 Marc Lorber | ||
* Copyright (C) 2013 Bernhard Schuster | ||
* Copyright (C) 2017 Guido Trentalancia | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License as | ||
|
@@ -37,9 +39,36 @@ | |
|
||
#include "pixmaps/logo.xpm" | ||
|
||
/* | ||
* Schedule a call to the oregano_error() function so that it is | ||
* called whenever there are no higher priority events pending. | ||
* | ||
* The caller should schedule this function call using the GLib | ||
* function g_idle_add_full(). | ||
*/ | ||
gboolean oregano_schedule_error (gchar *msg) { oregano_error_with_title (msg, NULL); return G_SOURCE_REMOVE; } | ||
|
||
/* | ||
* Schedule a call to the oregano_error_with_title() function | ||
* so that it is called whenever there are no higher priority | ||
* events pending. | ||
* | ||
* The caller should schedule this function call using the GLib | ||
* function g_idle_add_full(). | ||
*/ | ||
gboolean oregano_schedule_error_with_title (OreganoTitleMsg *tm) | ||
{ | ||
oregano_error_with_title (tm->title, tm->msg); | ||
g_free (tm->title); | ||
g_free (tm->msg); | ||
g_free (tm); | ||
|
||
return G_SOURCE_REMOVE; | ||
} | ||
|
||
void oregano_error (gchar *msg) { oregano_error_with_title (msg, NULL); } | ||
|
||
void oregano_error_with_title (gchar *title, gchar *desc) | ||
void oregano_error_with_title (gchar *title, gchar *msg) | ||
{ | ||
GtkWidget *dialog; | ||
GString *span_msg; | ||
|
@@ -48,25 +77,55 @@ void oregano_error_with_title (gchar *title, gchar *desc) | |
span_msg = g_string_append (span_msg, title); | ||
span_msg = g_string_append (span_msg, "</span>"); | ||
|
||
if (desc && desc[0] != '\0') { | ||
if (msg && msg[0] != '\0') { | ||
span_msg = g_string_append (span_msg, "\n\n"); | ||
span_msg = g_string_append (span_msg, desc); | ||
span_msg = g_string_append (span_msg, msg); | ||
} | ||
|
||
dialog = gtk_message_dialog_new_with_markup (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, | ||
GTK_BUTTONS_OK, "%s", span_msg->str); | ||
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, | ||
GTK_BUTTONS_CLOSE, NULL); | ||
|
||
gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), span_msg->str); | ||
|
||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); | ||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); | ||
|
||
gtk_dialog_run (GTK_DIALOG (dialog)); | ||
|
||
g_string_free (span_msg, TRUE); | ||
|
||
gtk_widget_destroy (dialog); | ||
} | ||
|
||
/* | ||
* Schedule a call to the oregano_warning() function so that it is | ||
* called whenever there are no higher priority events pending. | ||
* | ||
* The caller should schedule this function call using the GLib | ||
* function g_idle_add_full(). | ||
*/ | ||
gboolean oregano_schedule_warning (gchar *msg) { oregano_warning_with_title (msg, NULL); return G_SOURCE_REMOVE; } | ||
|
||
/* | ||
* Schedule a call to the oregano_warning_with_title() function | ||
* so that it is called whenever there are no higher priority | ||
* events pending. | ||
* | ||
* The caller should schedule this function call using the GLib | ||
* function g_idle_add_full(). | ||
*/ | ||
gboolean oregano_schedule_warning_with_title (OreganoTitleMsg *tm) | ||
{ | ||
oregano_warning_with_title (tm->title, tm->msg); | ||
g_free (tm->title); | ||
g_free (tm->msg); | ||
g_free (tm); | ||
|
||
return G_SOURCE_REMOVE; | ||
} | ||
|
||
void oregano_warning (gchar *msg) { oregano_warning_with_title (msg, NULL); } | ||
|
||
void oregano_warning_with_title (gchar *title, gchar *desc) | ||
void oregano_warning_with_title (gchar *title, gchar *msg) | ||
{ | ||
GtkWidget *dialog; | ||
GString *span_msg; | ||
|
@@ -75,35 +134,56 @@ void oregano_warning_with_title (gchar *title, gchar *desc) | |
span_msg = g_string_append (span_msg, title); | ||
span_msg = g_string_append (span_msg, "</span>"); | ||
|
||
if (desc && desc[0] != '\0') { | ||
if (msg && msg[0] != '\0') { | ||
span_msg = g_string_append (span_msg, "\n\n"); | ||
span_msg = g_string_append (span_msg, desc); | ||
span_msg = g_string_append (span_msg, msg); | ||
} | ||
|
||
dialog = gtk_message_dialog_new_with_markup (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, | ||
GTK_BUTTONS_OK, "%s", span_msg->str); | ||
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, | ||
GTK_BUTTONS_CLOSE, NULL); | ||
|
||
gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), span_msg->str); | ||
|
||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); | ||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); | ||
|
||
gtk_dialog_run (GTK_DIALOG (dialog)); | ||
|
||
g_string_free (span_msg, TRUE); | ||
|
||
gtk_widget_destroy (dialog); | ||
} | ||
|
||
/* | ||
* Schedule a call to the oregano_question() function so that it is | ||
* called whenever there are no higher priority events pending. | ||
* | ||
* The caller should schedule this function call using the GLib | ||
* function g_idle_add_full(). | ||
*/ | ||
gboolean oregano_schedule_question (OreganoQuestionAnswer *qa) { | ||
qa->ans = oregano_question (qa->msg); | ||
g_free (qa->msg); | ||
|
||
return G_SOURCE_REMOVE; | ||
} | ||
|
||
gint oregano_question (gchar *msg) | ||
{ | ||
GtkWidget *dialog; | ||
gint ans; | ||
|
||
dialog = gtk_message_dialog_new_with_markup (NULL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK, | ||
GTK_BUTTONS_CANCEL, "%s", msg); | ||
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, | ||
GTK_BUTTONS_YES_NO, NULL); | ||
|
||
gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), msg); | ||
|
||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL); | ||
|
||
ans = gtk_dialog_run (GTK_DIALOG (dialog)); | ||
|
||
gtk_widget_destroy (dialog); | ||
return (ans == GTK_RESPONSE_ACCEPT); | ||
|
||
return (ans == GTK_RESPONSE_YES); | ||
} | ||
|
||
void dialog_about (void) | ||
|
@@ -113,15 +193,17 @@ void dialog_about (void) | |
|
||
const gchar *authors[] = {"Richard Hult", "Margarita Manterola", "Andres de Barbara", | ||
"Gustavo M. Pereyra", "Maximiliano Curia", "Ricardo Markiewicz", | ||
"Marc Lorber", "Bernhard Schuster", NULL}; | ||
"Marc Lorber", "Bernhard Schuster", "Guido Trentalancia", | ||
NULL}; | ||
|
||
const char *docs[] = {"Ricardo Markiewicz <[email protected]> (es)", | ||
"Jordi Mallach <[email protected]> (ca)", | ||
"Marc Lorber <[email protected]> (en)", | ||
"Bernhard Schuster <[email protected]> (de)", | ||
"Bernhard Schuster <[email protected]> (de)", | ||
NULL}; | ||
|
||
const gchar *copy = _ ("(c) 2012-2017 Bernhard Schuster\n" | ||
const gchar *copy = _ ("(c) 2017 Guido Trentalancia\n" | ||
"(c) 2012-2017 Bernhard Schuster\n" | ||
"(c) 2009-2012 Marc Lorber\n" | ||
"(c) 2003-2006 LUGFi\n" | ||
"(c) 1999-2001 Richard Hult"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,14 @@ | |
* Ricardo Markiewicz <[email protected]> | ||
* Andres de Barbara <[email protected]> | ||
* Marc Lorber <[email protected]> | ||
* Guido Trentalancia <[email protected]> | ||
* | ||
* Web page: https://ahoi.io/project/oregano | ||
* | ||
* Copyright (C) 1999-2001 Richard Hult | ||
* Copyright (C) 2003,2004 Ricardo Markiewicz | ||
* Copyright (C) 2009-2012 Marc Lorber | ||
* Copyright (C) 2017 Guido Trentalancia | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License as | ||
|
@@ -35,10 +37,30 @@ | |
|
||
#include "schematic.h" | ||
|
||
typedef struct _OreganoTitleMsg OreganoTitleMsg; | ||
typedef struct _OreganoQuestionAnswer OreganoQuestionAnswer; | ||
|
||
struct _OreganoTitleMsg | ||
{ | ||
gchar *title; | ||
gchar *msg; | ||
}; | ||
|
||
struct _OreganoQuestionAnswer | ||
{ | ||
gchar *msg; | ||
gint ans; | ||
}; | ||
|
||
gboolean oregano_schedule_error (gchar *msg); | ||
gboolean oregano_schedule_error_with_title (OreganoTitleMsg *tm); | ||
void oregano_error (gchar *msg); | ||
void oregano_error_with_title (gchar *title, gchar *desc); | ||
void oregano_error_with_title (gchar *title, gchar *msg); | ||
gboolean oregano_schedule_warning (gchar *msg); | ||
gboolean oregano_schedule_warning_with_title (OreganoTitleMsg *tm); | ||
void oregano_warning (gchar *msg); | ||
void oregano_warning_with_title (gchar *title, gchar *desc); | ||
void oregano_warning_with_title (gchar *title, gchar *msg); | ||
gboolean oregano_schedule_question (OreganoQuestionAnswer *qa); | ||
gint oregano_question (gchar *msg); | ||
void dialog_about (void); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have any implications? I guess not since we do not check the the reutrn of
gtk_dialog_run
..