Attempt to make things work after 2 bottles of wine last night. Harmless
2003-01-19 Glynn Foster <glynn.foster@sun.com> * src/about.c: Attempt to make things work after 2 bottles of wine last night. Harmless changes though, so I'll commit them for posterity. * src/main.c: Add a new helper function for the error reporting that makes the translators life easier. Thanks to Ole for spotting this. * src/text.c, src/zenity.h: Lame white spacing hacking. * xmldocs.make: Put the docs in $(datadir)/help - not quite sure yet if yelp is going to like this or not.
This commit is contained in:
parent
37a276af52
commit
3a90fe7167
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
|||||||
|
2003-01-19 Glynn Foster <glynn.foster@sun.com>
|
||||||
|
|
||||||
|
* src/about.c: Attempt to make things work after 2 bottles of
|
||||||
|
wine last night. Harmless changes though, so I'll commit them
|
||||||
|
for posterity.
|
||||||
|
|
||||||
|
* src/main.c: Add a new helper function for the error reporting
|
||||||
|
that makes the translators life easier. Thanks to Ole for spotting
|
||||||
|
this.
|
||||||
|
|
||||||
|
* src/text.c, src/zenity.h: Lame white spacing hacking.
|
||||||
|
|
||||||
|
* xmldocs.make: Put the docs in $(datadir)/help - not quite sure
|
||||||
|
yet if yelp is going to like this or not.
|
||||||
|
|
||||||
2003-01-19 Mike Newman <mike@gtnorthern.demon.co.uk>
|
2003-01-19 Mike Newman <mike@gtnorthern.demon.co.uk>
|
||||||
|
|
||||||
* help/C/zenity.xml: fixed a missing closing tag.
|
* help/C/zenity.xml: fixed a missing closing tag.
|
||||||
|
@ -36,6 +36,7 @@ static GtkWidget *cred_dialog;
|
|||||||
|
|
||||||
static void zenity_about_dialog_response (GtkWidget *widget, int response, gpointer data);
|
static void zenity_about_dialog_response (GtkWidget *widget, int response, gpointer data);
|
||||||
|
|
||||||
|
/* Sync with the people in the THANKS file */
|
||||||
static const gchar *author_credits[] = {
|
static const gchar *author_credits[] = {
|
||||||
"Jonathan Blanford <jrb@redhat.com>",
|
"Jonathan Blanford <jrb@redhat.com>",
|
||||||
"Anders Carlsson <andersca@gnu.org>",
|
"Anders Carlsson <andersca@gnu.org>",
|
||||||
@ -239,6 +240,7 @@ zenity_about_dialog_response (GtkWidget *widget, int response, gpointer data)
|
|||||||
{
|
{
|
||||||
ZenityData *zen_data = data;
|
ZenityData *zen_data = data;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
gchar *help_string;
|
||||||
|
|
||||||
switch (response) {
|
switch (response) {
|
||||||
case GTK_RESPONSE_OK:
|
case GTK_RESPONSE_OK:
|
||||||
@ -247,7 +249,8 @@ zenity_about_dialog_response (GtkWidget *widget, int response, gpointer data)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case GTK_RESPONSE_HELP:
|
case GTK_RESPONSE_HELP:
|
||||||
zenity_util_show_help ("ghelp:///", NULL);
|
help_string = g_strconcat ("ghelp://", ZENITY_DATADIR, "help/zenity", NULL);
|
||||||
|
zenity_util_show_help (help_string, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GTK_RESPONSE_CREDITS:
|
case GTK_RESPONSE_CREDITS:
|
||||||
|
366
src/main.c
366
src/main.c
@ -41,6 +41,13 @@ typedef enum {
|
|||||||
MODE_LAST
|
MODE_LAST
|
||||||
} ZenityDialogMode;
|
} ZenityDialogMode;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ERROR_DUPLICATE,
|
||||||
|
ERROR_SUPPORT,
|
||||||
|
ERROR_DIALOG,
|
||||||
|
ERROR_LAST
|
||||||
|
} ZenityError;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ZenityDialogMode mode;
|
ZenityDialogMode mode;
|
||||||
ZenityData *data;
|
ZenityData *data;
|
||||||
@ -879,12 +886,33 @@ main (gint argc, gchar **argv) {
|
|||||||
exit (retval);
|
exit (retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static void
|
||||||
void zenity_parse_options_callback (poptContext ctx,
|
zenity_error (gchar *string, ZenityError error)
|
||||||
enum poptCallbackReason reason,
|
{
|
||||||
const struct poptOption *opt,
|
switch (error) {
|
||||||
const char *arg,
|
case ERROR_DUPLICATE:
|
||||||
void *data)
|
g_printerr (_("%s given twice for the same dialog\n"), string);
|
||||||
|
zenity_free_parsing_options ();
|
||||||
|
exit (-1);
|
||||||
|
case ERROR_SUPPORT:
|
||||||
|
g_printerr (_("%s is not supported for this dialog\n"), string);
|
||||||
|
zenity_free_parsing_options ();
|
||||||
|
exit (-1);
|
||||||
|
case ERROR_DIALOG:
|
||||||
|
g_printerr (_("Two or more dialog options specified\n"));
|
||||||
|
zenity_free_parsing_options ();
|
||||||
|
exit (-1);
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
zenity_parse_options_callback (poptContext ctx,
|
||||||
|
enum poptCallbackReason reason,
|
||||||
|
const struct poptOption *opt,
|
||||||
|
const char *arg,
|
||||||
|
void *data)
|
||||||
{
|
{
|
||||||
static gboolean parse_option_dateformat = FALSE;
|
static gboolean parse_option_dateformat = FALSE;
|
||||||
static gboolean parse_option_separator = FALSE;
|
static gboolean parse_option_separator = FALSE;
|
||||||
@ -900,103 +928,79 @@ void zenity_parse_options_callback (poptContext ctx,
|
|||||||
switch (opt->val & POPT_ARG_MASK) {
|
switch (opt->val & POPT_ARG_MASK) {
|
||||||
|
|
||||||
case OPTION_CALENDAR:
|
case OPTION_CALENDAR:
|
||||||
if (results->mode != MODE_LAST) {
|
if (results->mode != MODE_LAST)
|
||||||
g_printerr (_("Two or more dialog options specified\n"));
|
zenity_error (NULL, ERROR_DIALOG);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->mode = MODE_CALENDAR;
|
results->mode = MODE_CALENDAR;
|
||||||
break;
|
break;
|
||||||
case OPTION_ENTRY:
|
case OPTION_ENTRY:
|
||||||
if (results->mode != MODE_LAST) {
|
if (results->mode != MODE_LAST)
|
||||||
g_printerr (_("Two or more dialog options specified\n"));
|
zenity_error (NULL, ERROR_DIALOG);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->mode = MODE_ENTRY;
|
results->mode = MODE_ENTRY;
|
||||||
break;
|
break;
|
||||||
case OPTION_ERROR:
|
case OPTION_ERROR:
|
||||||
if (results->mode != MODE_LAST) {
|
if (results->mode != MODE_LAST)
|
||||||
g_printerr (_("Two or more dialog options specified\n"));
|
zenity_error (NULL, ERROR_DIALOG);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->mode = MODE_ERROR;
|
results->mode = MODE_ERROR;
|
||||||
results->msg_data->mode = ZENITY_MSG_ERROR;
|
results->msg_data->mode = ZENITY_MSG_ERROR;
|
||||||
break;
|
break;
|
||||||
case OPTION_INFO:
|
case OPTION_INFO:
|
||||||
if (results->mode != MODE_LAST) {
|
if (results->mode != MODE_LAST)
|
||||||
g_printerr (_("Two or more dialog options specified\n"));
|
zenity_error (NULL, ERROR_DIALOG);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->mode = MODE_INFO;
|
results->mode = MODE_INFO;
|
||||||
results->msg_data->mode = ZENITY_MSG_INFO;
|
results->msg_data->mode = ZENITY_MSG_INFO;
|
||||||
break;
|
break;
|
||||||
case OPTION_FILE:
|
case OPTION_FILE:
|
||||||
if (results->mode != MODE_LAST) {
|
if (results->mode != MODE_LAST)
|
||||||
g_printerr (_("Two or more dialog options specified\n"));
|
zenity_error (NULL, ERROR_DIALOG);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->mode = MODE_FILE;
|
results->mode = MODE_FILE;
|
||||||
break;
|
break;
|
||||||
case OPTION_LIST:
|
case OPTION_LIST:
|
||||||
if (results->mode != MODE_LAST) {
|
if (results->mode != MODE_LAST)
|
||||||
g_printerr (_("Two or more dialog options specified\n"));
|
zenity_error (NULL, ERROR_DIALOG);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->mode = MODE_LIST;
|
results->mode = MODE_LIST;
|
||||||
break;
|
break;
|
||||||
case OPTION_PROGRESS:
|
case OPTION_PROGRESS:
|
||||||
if (results->mode != MODE_LAST) {
|
if (results->mode != MODE_LAST)
|
||||||
g_printerr (_("Two or more dialog options specified\n"));
|
zenity_error (NULL, ERROR_DIALOG);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->mode = MODE_PROGRESS;
|
results->mode = MODE_PROGRESS;
|
||||||
break;
|
break;
|
||||||
case OPTION_QUESTION:
|
case OPTION_QUESTION:
|
||||||
if (results->mode != MODE_LAST) {
|
if (results->mode != MODE_LAST)
|
||||||
g_printerr (_("Two or more dialog options specified\n"));
|
zenity_error (NULL, ERROR_DIALOG);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->mode = MODE_QUESTION;
|
results->mode = MODE_QUESTION;
|
||||||
results->msg_data->mode = ZENITY_MSG_QUESTION;
|
results->msg_data->mode = ZENITY_MSG_QUESTION;
|
||||||
break;
|
break;
|
||||||
case OPTION_TEXTINFO:
|
case OPTION_TEXTINFO:
|
||||||
if (results->mode != MODE_LAST) {
|
if (results->mode != MODE_LAST)
|
||||||
g_printerr (_("Two or more dialog options specified\n"));
|
zenity_error (NULL, ERROR_DIALOG);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->mode = MODE_TEXTINFO;
|
results->mode = MODE_TEXTINFO;
|
||||||
break;
|
break;
|
||||||
case OPTION_WARNING:
|
case OPTION_WARNING:
|
||||||
if (results->mode != MODE_LAST) {
|
if (results->mode != MODE_LAST)
|
||||||
g_printerr (_("Two or more dialog options specified\n"));
|
zenity_error (NULL, ERROR_DIALOG);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->mode = MODE_WARNING;
|
results->mode = MODE_WARNING;
|
||||||
results->msg_data->mode = ZENITY_MSG_WARNING;
|
results->msg_data->mode = ZENITY_MSG_WARNING;
|
||||||
break;
|
break;
|
||||||
case OPTION_TITLE:
|
case OPTION_TITLE:
|
||||||
if (results->data->dialog_title != NULL) {
|
if (results->data->dialog_title != NULL)
|
||||||
g_printerr (_("--title given twice for the same dialog\n"));
|
zenity_error ("--title", ERROR_DUPLICATE);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->data->dialog_title = g_strdup (arg);
|
results->data->dialog_title = g_strdup (arg);
|
||||||
break;
|
break;
|
||||||
case OPTION_ICON:
|
case OPTION_ICON:
|
||||||
if (results->data->window_icon != NULL) {
|
if (results->data->window_icon != NULL)
|
||||||
g_printerr (_("--window-icon given twice for the same dialog\n"));
|
zenity_error ("--window-icon", ERROR_DUPLICATE);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->data->window_icon = g_strdup (arg);
|
results->data->window_icon = g_strdup (arg);
|
||||||
break;
|
break;
|
||||||
case OPTION_CALENDARTEXT:
|
case OPTION_CALENDARTEXT:
|
||||||
@ -1011,11 +1015,8 @@ void zenity_parse_options_callback (poptContext ctx,
|
|||||||
* parse_options_callback gets called for each option. Suckage
|
* parse_options_callback gets called for each option. Suckage
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (parse_option_text > 6) {
|
if (parse_option_text > 6)
|
||||||
g_printerr (_("--text given twice for the same dialog\n"));
|
zenity_error ("--text", ERROR_DUPLICATE);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (results->mode) {
|
switch (results->mode) {
|
||||||
case MODE_CALENDAR:
|
case MODE_CALENDAR:
|
||||||
@ -1034,102 +1035,72 @@ void zenity_parse_options_callback (poptContext ctx,
|
|||||||
results->progress_data->dialog_text = g_strdup (arg);
|
results->progress_data->dialog_text = g_strdup (arg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_printerr (_("--text is not supported for this dialog\n"));
|
zenity_error ("--text", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
}
|
||||||
parse_option_text++;
|
parse_option_text++;
|
||||||
break;
|
break;
|
||||||
case OPTION_DAY:
|
case OPTION_DAY:
|
||||||
if (results->mode != MODE_CALENDAR) {
|
if (results->mode != MODE_CALENDAR)
|
||||||
g_printerr (_("--day is not supported for this dialog\n"));
|
zenity_error ("--day", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
if (results->calendar_data->day > 0)
|
||||||
}
|
zenity_error ("--day", ERROR_DUPLICATE);
|
||||||
if (results->calendar_data->day > 0) {
|
|
||||||
g_printerr (_("--day given twice for the same dialog\n"));
|
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->calendar_data->day = atoi (arg);
|
results->calendar_data->day = atoi (arg);
|
||||||
break;
|
break;
|
||||||
case OPTION_MONTH:
|
case OPTION_MONTH:
|
||||||
if (results->mode != MODE_CALENDAR) {
|
if (results->mode != MODE_CALENDAR)
|
||||||
g_printerr (_("--month is not supported for this dialog\n"));
|
zenity_error ("--month", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
if (results->calendar_data->month > 0)
|
||||||
}
|
zenity_error ("--day", ERROR_DUPLICATE);
|
||||||
if (results->calendar_data->month > 0) {
|
|
||||||
g_printerr (_("--month given twice for the same dialog\n"));
|
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->calendar_data->month = atoi (arg);
|
results->calendar_data->month = atoi (arg);
|
||||||
break;
|
break;
|
||||||
case OPTION_YEAR:
|
case OPTION_YEAR:
|
||||||
if (results->mode != MODE_CALENDAR) {
|
if (results->mode != MODE_CALENDAR)
|
||||||
g_printerr (_("--year is not supported for this dialog\n"));
|
zenity_error ("--year", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
if (results->calendar_data->year > 0)
|
||||||
}
|
zenity_error ("--year", ERROR_DUPLICATE);
|
||||||
if (results->calendar_data->year > 0) {
|
|
||||||
g_printerr (_("--year given twice for the same dialog\n"));
|
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->calendar_data->year = atoi (arg);
|
results->calendar_data->year = atoi (arg);
|
||||||
break;
|
break;
|
||||||
case OPTION_DATEFORMAT:
|
case OPTION_DATEFORMAT:
|
||||||
if (results->mode != MODE_CALENDAR) {
|
if (results->mode != MODE_CALENDAR)
|
||||||
g_printerr (_("--date-format is not supported for this dialog\n"));
|
zenity_error ("--date-format", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
if (parse_option_dateformat == TRUE)
|
||||||
}
|
zenity_error ("--date-format", ERROR_DUPLICATE);
|
||||||
if (parse_option_dateformat == TRUE) {
|
|
||||||
g_printerr (_("--date-format given twice for the same dialog\n"));
|
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->calendar_data->date_format = g_strdup (arg);
|
results->calendar_data->date_format = g_strdup (arg);
|
||||||
parse_option_dateformat = TRUE;
|
parse_option_dateformat = TRUE;
|
||||||
break;
|
break;
|
||||||
case OPTION_INPUTTEXT:
|
case OPTION_INPUTTEXT:
|
||||||
if (results->mode != MODE_ENTRY) {
|
if (results->mode != MODE_ENTRY)
|
||||||
g_printerr (_("--entry-text is not supported for this dialog\n"));
|
zenity_error ("--entry-text", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
if (results->entry_data->entry_text != NULL)
|
||||||
}
|
zenity_error ("--entry-text", ERROR_DUPLICATE);
|
||||||
if (results->entry_data->entry_text != NULL) {
|
|
||||||
g_printerr (_("--entry-text given twice for the same dialog\n"));
|
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->entry_data->entry_text = g_strdup (arg);
|
results->entry_data->entry_text = g_strdup (arg);
|
||||||
break;
|
break;
|
||||||
case OPTION_HIDETEXT:
|
case OPTION_HIDETEXT:
|
||||||
if (results->mode != MODE_ENTRY) {
|
if (results->mode != MODE_ENTRY)
|
||||||
g_printerr (_("--hide-text is not supported for this dialog\n"));
|
zenity_error ("--hide-text", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
if (results->entry_data->visible == FALSE)
|
||||||
}
|
zenity_error ("--hide-text", ERROR_DUPLICATE);
|
||||||
if (results->entry_data->visible == FALSE) {
|
|
||||||
g_printerr (_("--hide-text given twice for the same dialog\n"));
|
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->entry_data->visible = FALSE;
|
results->entry_data->visible = FALSE;
|
||||||
break;
|
break;
|
||||||
case OPTION_TEXTEDIT:
|
case OPTION_TEXTEDIT:
|
||||||
if (results->mode != MODE_TEXTINFO) {
|
if (results->mode != MODE_TEXTINFO)
|
||||||
g_printerr (_("--editable is not supported for this dialog\n"));
|
zenity_error ("--editable", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
if (results->text_data->editable == TRUE)
|
||||||
}
|
zenity_error ("--editable", ERROR_DUPLICATE);
|
||||||
if (results->text_data->editable == TRUE) {
|
|
||||||
g_printerr (_("--editable given twice for the same dialog\n"));
|
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->text_data->editable = TRUE;
|
results->text_data->editable = TRUE;
|
||||||
break;
|
break;
|
||||||
case OPTION_FILENAME:
|
case OPTION_FILENAME:
|
||||||
@ -1140,11 +1111,8 @@ void zenity_parse_options_callback (poptContext ctx,
|
|||||||
* parse_options_callback gets called for each option. Suckage
|
* parse_options_callback gets called for each option. Suckage
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (parse_option_file > 2) {
|
if (parse_option_file > 2)
|
||||||
g_printerr (_("--filename given twice for the same dialog\n"));
|
zenity_error ("--filename", ERROR_DUPLICATE);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (results->mode) {
|
switch (results->mode) {
|
||||||
case MODE_FILE:
|
case MODE_FILE:
|
||||||
@ -1154,95 +1122,69 @@ void zenity_parse_options_callback (poptContext ctx,
|
|||||||
results->text_data->uri = g_strdup (arg);
|
results->text_data->uri = g_strdup (arg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_printerr (_("--filename is not supported for this dialog\n"));
|
zenity_error ("--filename", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
}
|
||||||
parse_option_file++;
|
parse_option_file++;
|
||||||
break;
|
break;
|
||||||
case OPTION_COLUMN:
|
case OPTION_COLUMN:
|
||||||
if (results->mode != MODE_LIST) {
|
if (results->mode != MODE_LIST)
|
||||||
g_printerr (_("--column is not supported for this dialog\n"));
|
zenity_error ("--column", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->tree_data->columns = g_slist_append (results->tree_data->columns, g_strdup (arg));
|
results->tree_data->columns = g_slist_append (results->tree_data->columns, g_strdup (arg));
|
||||||
break;
|
break;
|
||||||
case OPTION_CHECKLIST:
|
case OPTION_CHECKLIST:
|
||||||
if (results->mode != MODE_LIST) {
|
if (results->mode != MODE_LIST)
|
||||||
g_printerr (_("--checkbox is not supported for this dialog\n"));
|
zenity_error ("--checkbox", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
if (results->tree_data->checkbox == TRUE)
|
||||||
}
|
zenity_error ("--checkbox", ERROR_DUPLICATE);
|
||||||
if (results->tree_data->checkbox == TRUE) {
|
|
||||||
g_printerr (_("--checkbox given twice for the same dialog\n"));
|
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->tree_data->checkbox = TRUE;
|
results->tree_data->checkbox = TRUE;
|
||||||
break;
|
break;
|
||||||
case OPTION_RADIOLIST:
|
case OPTION_RADIOLIST:
|
||||||
if (results->mode != MODE_LIST) {
|
if (results->mode != MODE_LIST)
|
||||||
g_printerr (_("--radiobox is not supported for this dialog\n"));
|
zenity_error ("--radiobox", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
if (results->tree_data->radiobox == TRUE)
|
||||||
}
|
zenity_error ("--radiobox", ERROR_DUPLICATE);
|
||||||
if (results->tree_data->radiobox == TRUE) {
|
|
||||||
g_printerr (_("--radiobox given twice for the same dialog\n"));
|
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->tree_data->radiobox = TRUE;
|
results->tree_data->radiobox = TRUE;
|
||||||
break;
|
break;
|
||||||
case OPTION_SEPERATOR:
|
case OPTION_SEPERATOR:
|
||||||
if (results->mode != MODE_LIST) {
|
if (results->mode != MODE_LIST)
|
||||||
g_printerr (_("--separator is not supported for this dialog\n"));
|
zenity_error ("--separator", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
if (parse_option_separator == TRUE)
|
||||||
}
|
zenity_error ("--separator", ERROR_DUPLICATE);
|
||||||
if (parse_option_separator == TRUE) {
|
|
||||||
g_printerr (_("--separator given twice for the same dialog\n"));
|
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->tree_data->separator = g_strdup (arg);
|
results->tree_data->separator = g_strdup (arg);
|
||||||
parse_option_separator = TRUE;
|
parse_option_separator = TRUE;
|
||||||
break;
|
break;
|
||||||
case OPTION_PERCENTAGE:
|
case OPTION_PERCENTAGE:
|
||||||
if (results->mode != MODE_PROGRESS) {
|
if (results->mode != MODE_PROGRESS)
|
||||||
g_printerr (_("--percentage is not supported for this dialog\n"));
|
zenity_error ("--percentage", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
if (results->progress_data->percentage > -1)
|
||||||
}
|
zenity_error ("--percentage", ERROR_DUPLICATE);
|
||||||
if (results->progress_data->percentage > -1) {
|
|
||||||
g_printerr (_("--percentage given twice for the same dialog\n"));
|
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->progress_data->percentage = atoi (arg);
|
results->progress_data->percentage = atoi (arg);
|
||||||
break;
|
break;
|
||||||
case OPTION_PULSATE:
|
case OPTION_PULSATE:
|
||||||
if (results->mode != MODE_PROGRESS) {
|
if (results->mode != MODE_PROGRESS)
|
||||||
g_printerr (_("--pulsate is not supported for this dialog\n"));
|
zenity_error ("--pulsate", ERROR_SUPPORT);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->progress_data->pulsate = TRUE;
|
results->progress_data->pulsate = TRUE;
|
||||||
break;
|
break;
|
||||||
case OPTION_ABOUT:
|
case OPTION_ABOUT:
|
||||||
if (results->mode != MODE_LAST) {
|
if (results->mode != MODE_LAST)
|
||||||
g_printerr (_("Two or more dialog options specified\n"));
|
zenity_error (NULL, ERROR_DIALOG);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
results->mode = MODE_ABOUT;
|
results->mode = MODE_ABOUT;
|
||||||
break;
|
break;
|
||||||
case OPTION_VERSION:
|
case OPTION_VERSION:
|
||||||
if (results->mode != MODE_LAST) {
|
if (results->mode != MODE_LAST)
|
||||||
g_printerr (_("Two or more dialog options specified\n"));
|
zenity_error (NULL, ERROR_DIALOG);
|
||||||
zenity_free_parsing_options ();
|
|
||||||
exit (-1);
|
|
||||||
}
|
|
||||||
g_print ("%s\n", VERSION);
|
g_print ("%s\n", VERSION);
|
||||||
exit (0);
|
exit (0);
|
||||||
break;
|
break;
|
||||||
|
@ -86,7 +86,7 @@ zenity_text_dialog_response (GtkWidget *widget, int response, gpointer data)
|
|||||||
switch (response) {
|
switch (response) {
|
||||||
case GTK_RESPONSE_CLOSE:
|
case GTK_RESPONSE_CLOSE:
|
||||||
if (zen_text_data->editable) {
|
if (zen_text_data->editable) {
|
||||||
GtkTextIter start,end;
|
GtkTextIter start, end;
|
||||||
|
|
||||||
gtk_text_buffer_get_bounds (zen_text_data->buffer, &start, &end);
|
gtk_text_buffer_get_bounds (zen_text_data->buffer, &start, &end);
|
||||||
g_printerr (gtk_text_buffer_get_text (zen_text_data->buffer, &start, &end, 0));
|
g_printerr (gtk_text_buffer_get_text (zen_text_data->buffer, &start, &end, 0));
|
||||||
|
@ -68,7 +68,7 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
gchar *uri;
|
gchar *uri;
|
||||||
gboolean editable;
|
gboolean editable;
|
||||||
GtkTextBuffer *buffer;
|
GtkTextBuffer *buffer;
|
||||||
} ZenityTextData;
|
} ZenityTextData;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
# This variable (docdir) specifies where the documents should be installed.
|
# This variable (docdir) specifies where the documents should be installed.
|
||||||
# This default value should work for most packages.
|
# This default value should work for most packages.
|
||||||
# docdir = $(datadir)/@PACKAGE@/doc/$(docname)/$(lang)
|
# docdir = $(datadir)/@PACKAGE@/doc/$(docname)/$(lang)
|
||||||
docdir = $(datadir)/gnome/help/$(docname)/$(lang)
|
docdir = $(datadir)/zenity/help/$(docname)/$(lang)
|
||||||
|
|
||||||
# ************** You should not have to edit below this line *******************
|
# ************** You should not have to edit below this line *******************
|
||||||
xml_files = $(entities) $(docname).xml
|
xml_files = $(entities) $(docname).xml
|
||||||
|
Reference in New Issue
Block a user