Commit Graph

49 Commits

Author SHA1 Message Date
Javier Jardón c0c1ca9b7a Fix some compilations warnings 2020-12-18 08:28:41 +00:00
Arx Cruz 4eddb202ca Fix style
Fixing style in all zenity code, removing useless spaces,
empty lines, all code in 80 columns, etc.
2017-04-07 14:00:42 +02:00
Alan 3b64d05e8a Fix message dialog width and height on recent Gtk
The fix for Zenity bug 670496 "Zenity info/error windows grow in height
with message length"
(https://bugzilla.gnome.org/show_bug.cgi?id=670496) stopped working on
recent Gtk, which doesn't seem to honor gtk_widget_set_size_request.
This commit workarounds Gtk bug 657621 "Calculate the wrong height of
labels wrapping on words"
(https://bugzilla.gnome.org/show_bug.cgi?id=657621) by setting label's
width-chars and max-width-chars to 60. This magic number was picked from
GtkMessageDialog source
(https://git.gnome.org/browse/gtk+/tree/gtk/ui/gtkmessagedialog.ui#n48).
2017-04-04 15:48:51 +02:00
Matthias Clasen db4a0c3c0f Fix misleading indentation
Coverity flagged this.

https://bugzilla.gnome.org/show_bug.cgi?id=780217
2017-04-04 13:51:14 +02:00
Arx Cruz d063797fdf Fixing GLib-CRITICAL messages 2015-10-02 14:35:06 +02:00
Arx Cruz a0fa643f1c Merge branch 'jjardon/no_deprecated'
Conflicts:
	src/msg.c
2015-04-21 13:51:23 +02:00
Gama Anderson ba5ea0386d ADD gchar **extra_label TO struct ZenityData
this is done to keep the name of the extra buttons

ADD general option "extra-button" with string array as argument

	This will upon consecutive calls save the name of buttons in an array of strings

To all MODES, except notification.c and about.c ADD
  if (data->extra_label) {
    gint i=0;
    while(data->extra_label[i]!=NULL){
      gtk_dialog_add_button (GTK_DIALOG (dialog), data->extra_label[i], i);
      i++;
    }
  }

	This add the extra buttons to the dialog. The response is the number of the button

To all MODES response, except notification.c and about.c ADD
    default:
      if (response < g_strv_length(zen_data->extra_label))
        printf("%s\n",zen_data->extra_label[response]);

	This will print the button name to stdout when they are pressed

ADD question option "switch"

	This will suppress the standard "ok" and "cancel" button in question. This just wort in combination with --extra-button, otherwise error is raised.

	https://bugzilla.gnome.org/show_bug.cgi?id=118016
2015-04-21 13:00:44 +02:00
Andreas Mohr 4fe3fa98d9 Bug #734196
--info destroys X11 primary selection content, and does not document that either
2015-04-21 09:56:42 +02:00
Javier Jardón fba4f05582 Rework zenity_util_set_window_icon* to not use stock images 2015-03-22 09:16:16 +00:00
Javier Jardón 1a43253ac5 Do not use a stock answer for yes/no buttons 2015-03-22 09:16:16 +00:00
Javier Jardón 6fcbb80fd1 Do not use an icon for Cancel/OK buttons
GTK+ documentation recommends to not use an icons, but use
"_OK"/"_Cancel" labels instead
2015-03-22 09:16:16 +00:00
Arx Cruz b5460887fb Bug #700249 - Progress dialog does not wrap 2014-10-22 15:35:22 +02:00
Arx Cruz 210b073bcd Better sollution for wrap text
This fix is a better sollution for info, error, warning and
question dialog.
Now the dialog wraps the text properly, and don't allocate
a lot of height
2014-10-22 15:16:22 +02:00
Arx Cruz e5eb127e97 Bug #670496 and #673643
This fix the size of GtkLabel width when you have a big
text in the dialog.
2014-05-29 17:51:46 -03:00
Arx Cruz ec0c2f3292 Add the --ellipsize option to info, error, warning and question dialogs
This option will help people who need to add huge texts in their dialogs
and the window size get's very huge due amount of size that GtkLabel
requests
2014-05-20 16:05:32 -03:00
Berislav Kovacki b0fc720fe4 Bug #534935 Need hability to specify default answer in --question dialog 2013-11-23 16:44:26 -02:00
Weitian Leung 009523d5da added attach option for transient window 2013-08-31 00:26:51 -03:00
Florian Müllner bbcb2a3783 msg: Add an option to set a custom dialog icon
The predefined dialog icons work well in many cases, but sometimes
it makes sense to use a more specific icon, so add an option to
specify an icon-name to use instead.

https://bugzilla.gnome.org/show_bug.cgi?id=684329
2012-09-25 18:46:33 -04:00
Florian Müllner 0628bd3291 util: Add an option to request dialogs being modal
As WMs cannot open windows themselves, Mutter uses zenity to open
"Force Quit" dialogs for unresponsive windows; as those are strongly
tied to the corresponding window, it makes sense to make them modal
(in particular when attaching them to their parent).

https://bugzilla.gnome.org/show_bug.cgi?id=684322
2012-09-25 18:46:12 -04:00
Arx Cruz 6768a40e99 Fix for bug #611297 Now Zenity have --ok-label and --cancel-label in all dialogs. This patch doesn't break old zenity scripts. 2011-07-26 14:02:45 -03:00
Arx Cruz 3f5c166792 Forgot change one option in gtk_label 2011-07-06 15:09:38 -03:00
Arx Cruz d8954d9222 Patch for bug #621907
This patch add the option --no-markup in the info, warning, error and question dialogs
So if the user wants to use & \ ' and other symbols, now he can, and no error will be
showed.
2011-07-06 14:58:49 -03:00
Arx Cruz d60e5eeeb3 Now if you use --timeout option, the return code will be properly handled
The default behavior will be done (ie. user click on ok button)
The return code will be 5
2011-06-17 10:51:00 -03:00
Arx Cruz f77a0199af Fix the msg forms (question, warning, error) to return 5 when timeout 2011-06-16 14:45:52 -03:00
Arx Cruz b39ad33c35 Bug 651948 - zenity list does not return default value when timeout is over 2011-06-16 11:34:01 -03:00
Philippe Gauthier 1570a2bbf0 Use g_timeout_add_seconds instead g_timeout_add
The calls to g_timeout_add are replaced with g_timeout_add_seconds to
reduce the number or program wake ups. See the GNOME Goal description:
http://live.gnome.org/GnomeGoals/UseTimeoutAddSeconds
2010-05-27 20:49:45 -03:00
Lucas Rocha c1f2e66288 Bug 572835 – Zenity --question should be yes or no 2009-08-10 04:17:47 +01:00
Felix Riemann 3f33966167 Bug 578393 – convert from libglade to GtkBuilder 2009-07-20 10:23:32 +02:00
Lucas Rocha eeb43bf65b fix memory leak on custom labels (Fixes bug #526627). Patch by
2008-03-30  Lucas Rocha  <lucasr@gnome.org>

	* src/msg.c (zenity_msg_construct_question_dialog): fix memory leak on
	custom labels (Fixes bug #526627). Patch by kraai@ftbfs.org.

svn path=/trunk/; revision=1348
2008-04-07 19:06:21 +00:00
Lucas Rocha 2141cb9184 Allow question dialogs to use custom button label text (Fixes bug
2008-03-30  Lucas Rocha  <lucasr@gnome.org>

	Allow question dialogs to use custom button label text (Fixes 
	bug #335763). Patch from Cosimo Cecchi <anarki@lilik.it> and 
	Thomas Thurman <tthurman@gnome.org>.

	* src/msg.c (zenity_msg_construct_question_dialog), (zenity_msg):
	dynamically add dialog buttons with provided labels.
	* src/option.c (zenity_option_free): free input labels.
	(zenity_question_post_callback): set button labels provided by the
	respective command line options.
	* src/zenity.glade: remove pre-defined dialog button from question
	dialog.
	* src/zenity.h: added ok_label and cancel_label to ZenityMsgData.

svn path=/trunk/; revision=1346
2008-03-29 22:13:50 +00:00
Lucas Rocha 8b16d4d412 added timeout option to all dialogs (Fixes bug #160654). Based on patch
2007-08-13  Lucas Rocha  <lucasr@gnome.org>

	* src/*.c: added timeout option to all dialogs (Fixes bug #160654).
	Based on patch from Muthiah Annamalai <gnumuthu@users.sf.net>.

svn path=/trunk/; revision=1231
2007-08-13 20:36:29 +00:00
Lucas Rocha c8b9b79813 make it possible to add new lines in the in the msg dialog (Fixes bug
2005-11-13  Lucas Rocha  <lucasr@cvs.gnome.org>

        * src/msg.c: make it possible to add new lines in the
        in the msg dialog (Fixes bug #320787).
2005-11-14 04:25:58 +00:00
Lucas Almeida Rocha 4c328078b6 Include cleanups (config.h) 2005-07-06 20:13:11 +00:00
Glynn Foster 6abd93050f COPYING, src/about.c, src/calendar.c, src/eggtrayicon.c, src/entry.c,
2005-04-25  Glynn Foster  <glynn.foster@sun.com>

	* COPYING, src/about.c, src/calendar.c, src/eggtrayicon.c,
	* src/entry.c, src/fileselection.c, src/main.c, src/msg.c,
	* src/notification.c, src/option.c, src/progress.c,
	* src/text.c, src/tree.c, src/util.c: Update the FSF address
	to point to 51 Franklin Street, Fifth Floor as per forwarded
	mail from Alvaro Lopez Ortega.
2005-04-25 03:20:45 +00:00
Glynn Foster 6e6eeaf79c Bug fix for #149290, based on contributions from Timo Aaltonen, Lucas
2005-04-20  Glynn Foster  <glynn.foster@sun.com>

	* src/msg.c, src/option.c, src/zenity.h: Bug fix for
	#149290, based on contributions from Timo Aaltonen,
	Lucas Rocha, and Carlos Parra.
	* THANKS: Update.
2005-04-20 01:59:42 +00:00
Glynn Foster 3e05834b4c Add new notification icon. Update for new files. Restructure code a little
2004-09-13  Glynn Foster  <glynn.foster@sun.com>

	* data/Makefile.am, data/zenity-notification.png: Add new
	notification icon.
	* src/Makefile.am: Update for new files.
	* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
	src/progress.c, src/text.c, src/tree.c, src/msg.c: Restructure code a
	little bit for new utility functions for setting window icons.
	* src/eggtrayicon.c, src/eggtrayicon.h: New files for notification area
	support.
	* src/main.c, src/notification.c, src/util.c, src/util.h, src/zenity.h:
	Add support for notification area.
	* data/zenity.1, help/*: Update docs for notification and new file
	selection changes.
2004-09-13 07:51:51 +00:00
Glynn Foster 63661a6ea0 src/calendar.c, src/entry.c, src/fileselection.c, Cleanup fixes from Paul
2004-07-19  Glynn Foster  <glynn.foster@sun.com>

	* src/calendar.c, src/entry.c, src/fileselection.c,
	* src/msg.c, src/progress.c, src/text.c, src/tree.c: Cleanup
	fixes from Paul Bolle.
2004-07-19 01:13:40 +00:00
Glynn Foster 6a17938c95 Make sure the text can take markup, so that people can create nice HIG
2004-07-19  Glynn Foster  <glynn.foster@sun.com>

	* src/msg.c: Make sure the text can take markup, so
	that people can create nice HIG compliant message
	dialogs. Patch from Sebastian Heinlein. Fixes #140748.
2004-07-18 23:40:20 +00:00
Glynn Foster 62785ed80f Add from the 2 Sebastian's, and make email addresses more spam proof.
2004-04-26  Glynn Foster  <glynn.foster@sun.com>

	* THANKS, src/about.c: Add from the 2 Sebastian's, and make
	email addresses more spam proof.
	* src/calendar.c, src/entry.c, src/fileselection.c, src/msg.c,
	* src/progress.c, src/text.c, src/tree.c, src/util.c,
	* src/util.h: Patch from Sebastian Kapfer to make all zenity
	dialogs transients of the parent xterm. Fixes #136226.
	* src/zenity.glade: Patch from Sebastian Heinlein to
	improve things HIG wise. Fixes #140745.
2004-04-26 04:41:25 +00:00
Glynn Foster b43bbda2e2 Patch from Darren Adams <darrenadams@dsl.pipex.com> to make sure the new
2004-03-19  Glynn Foster  <glynn.foster@sun.com>

	* src/calendar.c, src/entry.c, src/fileselection.c,
	src/msg.c, src/progress.c, src/text.c, src/tree.c:
	Patch from Darren Adams <darrenadams@dsl.pipex.com> to make
	sure the new file chooser resizes nicely. Sanitize the default
	setting of the other widgets.
	* configure.in, src/util.c: Lose gconf dependancy since we
	don't currently use it, although arguably we should to detect
	which help browser we're supposed to run :/
	* THANKS, src/about.c: Add Darren to the list.
2004-03-19 02:28:30 +00:00
Mike Newman 5bade6fe6a Support user-defined return values via env vars, like dialog did. 2003-06-07 14:41:56 +00:00
Glynn Foster 65cb873430 Fix up some build warnings as reported by Ross Burton and his amazing gcc
2003-06-04  Glynn Foster  <glynn.foster@sun.com>

	* src/about.c, src/main.c, src/msg.c,
	src/progress.c, src/tree.c, src/util.c: Fix up some build warnings
	as reported by Ross Burton and his amazing gcc 3.3 techno machine.
2003-06-04 12:53:46 +00:00
Glynn Foster 965c2a9149 Finish off the indentation cleanup. Add new '--width' and '--height'
2003-04-13  Glynn Foster  <glynn.foster@sun.com>

	* src/calendar.c, src/entry.c, src/fileselection.c,
	src/main.c, src/msg.c, src/progress.c, src/text.c,
	src/tree.c, src/zenity.h: Finish off the indentation cleanup.
	Add new '--width' and '--height' options to the general options.
	Fix up the radio list view, so that we can now act like a radio
	button group.

	* TODO: Update
2003-04-13 15:42:41 +00:00
Glynn Foster 49f8979534 Mass indentation cleanup. Make sure the glade dialogs aren't initially
2003-03-10  Glynn Foster  <glynn.foster@sun.com>

	* src/about.c, src/calendar.c, src/entry.c, src/fileselection.c,
	src/main.c, src/msg.c, src/progress.c, src/text.c, src/tree.c,
	src/util.c, src/util.h, src/zenity.glade, src/zenity.h:

	Mass indentation cleanup. Make sure the glade dialogs aren't initially
	visible because this avoids a visibility jump. Apparently == TRUE is
	bad mojo. Fix up.
2003-03-10 17:11:18 +00:00
Glynn Foster c41421c043 Add some screenshots for the help documentation.
2003-01-18  Glynn Foster  <glynn.foster@sun.com>

	* help/C/figures/zenity-calendar-screenshot.png,
	help/C/figures/zenity-entry-screenshot.png,
	help/C/figures/zenity-error-screenshot.png,
	help/C/figures/zenity-fileselection-screenshot.png,
	help/C/figures/zenity-information-screenshot.png,
	help/C/figures/zenity-list-screenshot.png,
	help/C/figures/zenity-progress-screenshot.png,
	help/C/figures/zenity-question-screenshot.png,
	help/C/figures/zenity-text-screenshot.png,
	help/C/figures/zenity-warning-screenshot.png: Add some
	screenshots for the help documentation.

	* src/entry.c, src/msg.c: Don't set the text if it's NULL.
2003-01-18 18:30:52 +00:00
Glynn Foster 1e0ff80be4 Re-structure the code to pass in the ZenityData structure into the
2003-01-13  Glynn Foster  <glynn.foster@sun.com>

	* src/calendar.c: Re-structure the code to pass in the
	ZenityData structure into the response_callback instead.

	* src/main.c: Fix the screwups in the commandline parser
	due to popt being teh suck.

	* src/msg.c: Don't unref the GladeXML before you use it.

	* THANKS: New file.
2003-01-13 18:16:50 +00:00
Glynn Foster 6a65d75921 Fix up the response signal handlers. Use returns of 0 for 'Ok' and
2003-01-07  Glynn Foster  <glynn.foster@sun.com>

	* src/calendar.c, src/entry.c, src/fileselection.c,
	src/main.c, src/msg.c, src/progress.c, src/text.c,
	src/tree.c, src/zenity.glade, src/zenity.h: Fix up
	the response signal handlers. Use returns of 0 for
	'Ok' and 'Close', 1 for 'Cancel' and 'Escape' and
	-1 for 'Uh Oh'. Get stuff printing to stderr. Fix up
	the error handling that I thought was improved,
	although still have issues with popt callback getting
	called numerous times because of more than one instance
	of the same kind is being used in poptOption.

	* TODO: Update accordingly.
2003-01-07 13:22:57 +00:00
Glynn Foster 8924d5c401 I love featuritis. Instead of fixing stuff so it actually works, I add
2003-01-06  Glynn Foster  <glynn.foster@sun.com>

	* src/main.c, src/msg.c, src/zenity.glade,
	src/zenity.h: I love featuritis. Instead of fixing
	stuff so it actually works, I add more stuff. Add
	support for info dialog.
2003-01-06 21:09:22 +00:00
Glynn Foster 48c1564ac5 Initial revision 2003-01-03 13:26:04 +00:00