summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLucas Rocha <lucasr@gnome.org>2005-12-13 04:18:58 +0000
committerLucas Almeida Rocha <lucasr@src.gnome.org>2005-12-13 04:18:58 +0000
commit285cb79bafd2616f2d2dd7eb2ae82527942ef4cc (patch)
tree3707186b904f1a6af837d740e2ebf22a3bb2ec10 /src
parentpost release version bump. (diff)
downloadzenity-285cb79bafd2616f2d2dd7eb2ae82527942ef4cc.tar.gz
zenity-285cb79bafd2616f2d2dd7eb2ae82527942ef4cc.tar.bz2
zenity-285cb79bafd2616f2d2dd7eb2ae82527942ef4cc.zip
new scale dialog for selecting a value from a range (Fixes #322399).
2005-12-13 Lucas Rocha <lucasr@gnome.org> * data/Makefile.am, data/zenity-scale.png, src/Makefile.am, src/main.c, src/option.c, src/option.h, src/scale.c, src/zenity.glade, src/zenity.h: new scale dialog for selecting a value from a range (Fixes #322399).
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/main.c3
-rw-r--r--src/option.c125
-rw-r--r--src/option.h2
-rw-r--r--src/scale.c122
-rw-r--r--src/zenity.glade213
-rw-r--r--src/zenity.h9
7 files changed, 468 insertions, 7 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 6b43b3e1..e3c62d53 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,6 +9,7 @@ zenity_SOURCES = \
zenity.h \
calendar.c \
msg.c \
+ scale.c \
fileselection.c \
entry.c \
text.c \
diff --git a/src/main.c b/src/main.c
index 09330d55..7077af8a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -64,6 +64,9 @@ main (gint argc, gchar **argv) {
case MODE_INFO:
zenity_msg (results->data, results->msg_data);
break;
+ case MODE_SCALE:
+ zenity_scale (results->data, results->scale_data);
+ break;
case MODE_FILE:
zenity_fileselection (results->data, results->file_data);
break;
diff --git a/src/option.c b/src/option.c
index 19089305..f3f26b3a 100644
--- a/src/option.c
+++ b/src/option.c
@@ -91,6 +91,14 @@ static gboolean zenity_text_active;
/* Warning Dialog Options */
static gboolean zenity_warning_active;
+/* Scale Dialog Options */
+static gboolean zenity_scale_active;
+static gint zenity_scale_value;
+static gint zenity_scale_min_value;
+static gint zenity_scale_max_value;
+static gint zenity_scale_step;
+static gboolean zenity_scale_print_partial;
+
/* Miscelaneus Options */
static gboolean zenity_misc_about;
static gboolean zenity_misc_version;
@@ -646,6 +654,75 @@ static GOptionEntry warning_options[] = {
}
};
+static GOptionEntry scale_options[] = {
+ {
+ "scale",
+ '\0',
+ G_OPTION_FLAG_IN_MAIN,
+ G_OPTION_ARG_NONE,
+ &zenity_scale_active,
+ N_("Display scale dialog"),
+ NULL
+ },
+ {
+ "text",
+ '\0',
+ G_OPTION_FLAG_NOALIAS,
+ G_OPTION_ARG_STRING,
+ &zenity_general_dialog_text,
+ N_("Set the dialog text"),
+ NULL
+ },
+ {
+ "value",
+ '\0',
+ 0,
+ G_OPTION_ARG_INT,
+ &zenity_scale_value,
+ N_("Set initial value"),
+ NULL
+ },
+ {
+ "min-value",
+ '\0',
+ 0,
+ G_OPTION_ARG_INT,
+ &zenity_scale_min_value,
+ N_("Set minimum value"),
+ NULL
+ },
+ {
+ "max-value",
+ '\0',
+ 0,
+ G_OPTION_ARG_INT,
+ &zenity_scale_max_value,
+ N_("Set maximum value"),
+ NULL
+ },
+ {
+ "step",
+ '\0',
+ 0,
+ G_OPTION_ARG_INT,
+ &zenity_scale_step,
+ N_("Set step size"),
+ NULL
+ },
+ {
+ "print-partial",
+ '\0',
+ 0,
+ G_OPTION_ARG_NONE,
+ &zenity_scale_print_partial,
+ N_("Print partial values"),
+ NULL
+ },
+ {
+ NULL
+ }
+};
+
static GOptionEntry miscellaneous_options[] = {
{
"about",
@@ -683,6 +760,7 @@ zenity_option_init (void) {
results->data = g_new0 (ZenityData, 1);
results->calendar_data = g_new0 (ZenityCalendarData, 1);
results->msg_data = g_new0 (ZenityMsgData, 1);
+ results->scale_data = g_new0 (ZenityScaleData, 1);
results->file_data = g_new0 (ZenityFileData, 1);
results->entry_data = g_new0 (ZenityEntryData, 1);
results->progress_data = g_new0 (ZenityProgressData, 1);
@@ -913,6 +991,22 @@ zenity_warning_pre_callback (GOptionContext *context,
}
static gboolean
+zenity_scale_pre_callback (GOptionContext *context,
+ GOptionGroup *group,
+ gpointer data,
+ GError **error)
+{
+ zenity_scale_active = FALSE;
+ zenity_scale_value = 0;
+ zenity_scale_min_value = 0;
+ zenity_scale_max_value = 100;
+ zenity_scale_step = 1;
+ zenity_scale_print_partial = FALSE;
+
+ return TRUE;
+}
+
+static gboolean
zenity_misc_pre_callback (GOptionContext *context,
GOptionGroup *group,
gpointer data,
@@ -1235,6 +1329,26 @@ zenity_warning_post_callback (GOptionContext *context,
}
static gboolean
+zenity_scale_post_callback (GOptionContext *context,
+ GOptionGroup *group,
+ gpointer data,
+ GError **error)
+{
+ zenity_option_set_dialog_mode (zenity_scale_active, MODE_SCALE);
+
+ if (results->mode == MODE_SCALE) {
+ results->scale_data->dialog_text = zenity_general_dialog_text;
+ results->scale_data->value = zenity_scale_value;
+ results->scale_data->min_value = zenity_scale_min_value;
+ results->scale_data->max_value = zenity_scale_max_value;
+ results->scale_data->step = zenity_scale_step;
+ results->scale_data->print_partial = zenity_scale_print_partial;
+ }
+
+ return TRUE;
+}
+
+static gboolean
zenity_misc_post_callback (GOptionContext *context,
GOptionGroup *group,
gpointer data,
@@ -1375,6 +1489,17 @@ zenity_create_context (void)
g_option_group_set_translation_domain (a_group, GETTEXT_PACKAGE);
g_option_context_add_group(tmp_ctx, a_group);
+ /* Adds scale option entries */
+ a_group = g_option_group_new("scale",
+ N_("Scale options"),
+ N_("Show scale options"), NULL, 0);
+ g_option_group_add_entries(a_group, scale_options);
+ g_option_group_set_parse_hooks (a_group,
+ zenity_scale_pre_callback, zenity_scale_post_callback);
+ g_option_group_set_error_hook (a_group, zenity_option_error_callback);
+ g_option_group_set_translation_domain (a_group, GETTEXT_PACKAGE);
+ g_option_context_add_group(tmp_ctx, a_group);
+
/* Adds text option entries */
a_group = g_option_group_new("text-info",
N_("Text information options"),
diff --git a/src/option.h b/src/option.h
index 63b28243..cce0553d 100644
--- a/src/option.h
+++ b/src/option.h
@@ -42,6 +42,7 @@ typedef enum {
MODE_QUESTION,
MODE_TEXTINFO,
MODE_WARNING,
+ MODE_SCALE,
MODE_INFO,
MODE_NOTIFICATION,
MODE_ABOUT,
@@ -62,6 +63,7 @@ typedef struct {
ZenityCalendarData *calendar_data;
ZenityMsgData *msg_data;
+ ZenityScaleData *scale_data;
ZenityFileData *file_data;
ZenityEntryData *entry_data;
ZenityProgressData *progress_data;
diff --git a/src/scale.c b/src/scale.c
new file mode 100644
index 00000000..228995e6
--- /dev/null
+++ b/src/scale.c
@@ -0,0 +1,122 @@
+/*
+ * scale.c
+ *
+ * Copyright (C) 2002 Sun Microsystems, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * Authors: Lucas Rocha <lucasr@gnome.org>
+ */
+
+#include "config.h"
+
+#include <glade/glade.h>
+#include "zenity.h"
+#include "util.h"
+
+static GtkWidget *scale;
+
+static void zenity_scale_value_changed (GtkWidget *widget, gpointer data);
+static void zenity_scale_dialog_response (GtkWidget *widget, int response, gpointer data);
+
+void
+zenity_scale (ZenityData *data, ZenityScaleData *scale_data)
+{
+ GladeXML *glade_dialog;
+ GtkWidget *dialog;
+ GtkWidget *text;
+
+ glade_dialog = zenity_util_load_glade_file ("zenity_scale_dialog");
+ dialog = glade_xml_get_widget (glade_dialog, "zenity_scale_dialog");
+ scale = glade_xml_get_widget (glade_dialog, "zenity_scale_hscale");
+ text = glade_xml_get_widget (glade_dialog, "zenity_scale_text");
+
+ g_signal_connect (G_OBJECT (dialog), "response",
+ G_CALLBACK (zenity_scale_dialog_response), data);
+
+ if (glade_dialog == NULL) {
+ data->exit_code = zenity_util_return_exit_code (ZENITY_ERROR);
+ return;
+ }
+
+ if (scale_data->min_value >= scale_data->max_value) {
+ g_printerr (_("Maximum value must be greater than minimum value.\n"));
+ data->exit_code = zenity_util_return_exit_code (ZENITY_ERROR);
+ return;
+ }
+
+ if (scale_data->value < scale_data->min_value ||
+ scale_data->value > scale_data->max_value) {
+ g_printerr (_("Value out of range.\n"));
+ data->exit_code = zenity_util_return_exit_code (ZENITY_ERROR);
+ return;
+ }
+
+ glade_xml_signal_autoconnect (glade_dialog);
+
+ if (glade_dialog)
+ g_object_unref (glade_dialog);
+
+ if (data->dialog_title)
+ gtk_window_set_title (GTK_WINDOW (dialog), data->dialog_title);
+
+ zenity_util_set_window_icon (dialog, data->window_icon, ZENITY_IMAGE_FULLPATH ("zenity-scale.png"));
+
+ if (data->width > -1 || data->height > -1)
+ gtk_window_set_default_size (GTK_WINDOW (dialog), data->width, data->height);
+
+ if (scale_data->dialog_text)
+ gtk_label_set_markup (GTK_LABEL (text), g_strcompress (scale_data->dialog_text));
+
+ gtk_range_set_value (GTK_RANGE (scale), scale_data->value);
+ gtk_range_set_range (GTK_RANGE (scale), scale_data->min_value, scale_data->max_value);
+ gtk_range_set_increments (GTK_RANGE (scale), scale_data->step, 0);
+
+ if (scale_data->print_partial)
+ g_signal_connect (G_OBJECT (scale), "value-changed",
+ G_CALLBACK (zenity_scale_value_changed), data);
+
+ zenity_util_show_dialog (dialog);
+ gtk_main ();
+}
+
+static void
+zenity_scale_value_changed (GtkWidget *widget, gpointer data)
+{
+ g_print ("%.0f\n", gtk_range_get_value (GTK_RANGE (widget)));
+}
+
+static void
+zenity_scale_dialog_response (GtkWidget *widget, int response, gpointer data)
+{
+ ZenityData *zen_data = data;
+
+ switch (response) {
+ case GTK_RESPONSE_OK:
+ zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
+ g_print ("%.0f\n", gtk_range_get_value (GTK_RANGE (scale)));
+ break;
+
+ case GTK_RESPONSE_CANCEL:
+ zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL);
+ break;
+
+ default:
+ zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);
+ break;
+ }
+ gtk_main_quit ();
+}
diff --git a/src/zenity.glade b/src/zenity.glade
index 22049ba9..66dc3cce 100644
--- a/src/zenity.glade
+++ b/src/zenity.glade
@@ -15,6 +15,8 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
<property name="has_separator">True</property>
<signal name="destroy" handler="gtk_main_quit" last_modification_time="Fri, 27 Dec 2002 19:08:11 GMT"/>
@@ -90,6 +92,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -119,6 +125,10 @@
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">zenity_calendar</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
<accessibility>
<atkrelation target="zenity_calendar" type="label-for"/>
</accessibility>
@@ -166,6 +176,8 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
<property name="has_separator">False</property>
<signal name="destroy" handler="gtk_main_quit" last_modification_time="Fri, 27 Dec 2002 23:24:20 GMT"/>
@@ -252,6 +264,10 @@
<property name="yalign">0</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -283,6 +299,8 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
<property name="show_fileops">True</property>
<signal name="destroy" handler="gtk_main_quit" last_modification_time="Sat, 28 Dec 2002 11:48:27 GMT"/>
@@ -321,6 +339,8 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
<property name="has_separator">False</property>
<signal name="destroy" handler="gtk_main_quit" last_modification_time="Sat, 28 Dec 2002 12:03:54 GMT"/>
@@ -407,6 +427,10 @@
<property name="yalign">0</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -437,6 +461,8 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
<property name="has_separator">True</property>
<signal name="destroy" handler="gtk_main_quit" last_modification_time="Sat, 28 Dec 2002 12:15:37 GMT"/>
@@ -513,6 +539,10 @@
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">zenity_entry_input</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
<accessibility>
<atkrelation target="zenity_entry_input" type="label-for"/>
</accessibility>
@@ -533,7 +563,7 @@
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
+ <property name="invisible_char">*</property>
<property name="activates_default">True</property>
</widget>
<packing>
@@ -575,6 +605,8 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
<property name="has_separator">False</property>
<signal name="destroy" handler="gtk_main_quit" last_modification_time="Sat, 28 Dec 2002 12:34:38 GMT"/>
@@ -675,6 +707,8 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
<property name="has_separator">True</property>
<signal name="destroy" handler="gtk_main_quit" last_modification_time="Sat, 28 Dec 2002 14:46:29 GMT"/>
@@ -751,6 +785,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -764,8 +802,9 @@
<property name="visible">True</property>
<property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
<property name="fraction">0</property>
- <property name="pulse_step">0.1</property>
+ <property name="pulse_step">0.10000000149</property>
<property name="text" translatable="yes"></property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -804,6 +843,8 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
<property name="has_separator">False</property>
<signal name="destroy" handler="gtk_main_quit" last_modification_time="Sat, 28 Dec 2002 15:05:42 GMT"/>
@@ -883,6 +924,10 @@
<property name="yalign">0</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -914,7 +959,7 @@
<property name="window_position">GTK_WIN_POS_CENTER</property>
<property name="modal">False</property>
<property name="default_width">300</property>
- <property name="default_height">200</property>
+ <property name="default_height">196</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
@@ -922,6 +967,8 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
<property name="has_separator">True</property>
<signal name="destroy" handler="gtk_main_quit" last_modification_time="Sat, 28 Dec 2002 22:19:04 GMT"/>
@@ -996,6 +1043,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1017,11 +1068,14 @@
<widget class="GtkTreeView" id="zenity_tree_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="has_focus">True</property>
+ <property name="has_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
+ <property name="fixed_height_mode">False</property>
+ <property name="hover_selection">False</property>
+ <property name="hover_expand">False</property>
</widget>
</child>
</widget>
@@ -1062,6 +1116,8 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
<property name="has_separator">False</property>
<signal name="destroy" handler="gtk_main_quit" last_modification_time="Sat, 28 Dec 2002 15:05:42 GMT"/>
@@ -1140,6 +1196,10 @@
<property name="yalign">0</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1177,6 +1237,8 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
<property name="has_separator">True</property>
<signal name="destroy" handler="gtk_main_quit" last_modification_time="Tue, 14 Jan 2003 02:38:19 GMT"/>
@@ -1265,7 +1327,7 @@
<widget class="GtkLabel" id="zenity_about_version">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="no">zenity_about_version</property>
+ <property name="label">zenity_about_version</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
@@ -1275,6 +1337,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1287,7 +1353,7 @@
<widget class="GtkLabel" id="zenity_about_description">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="no">zenity_about_description</property>
+ <property name="label">zenity_about_description</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
@@ -1297,6 +1363,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1309,7 +1379,7 @@
<widget class="GtkLabel" id="zenity_about_copyright">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="no">zenity_about_copyright</property>
+ <property name="label">zenity_about_copyright</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
@@ -1319,6 +1389,10 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1337,4 +1411,129 @@
</child>
</widget>
+<widget class="GtkDialog" id="zenity_scale_dialog">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Adjust the scale value</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="default_width">300</property>
+ <property name="default_height">100</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+ <property name="has_separator">True</property>
+ <signal name="destroy" handler="gtk_main_quit" last_modification_time="Tue, 13 Dec 2005 04:03:21 GMT"/>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox11">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area11">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="cancelbutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="okbutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox13">
+ <property name="border_width">3</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="zenity_scale_text">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Adjust the scale value.</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">4</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHScale" id="zenity_scale_hscale">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="draw_value">True</property>
+ <property name="value_pos">GTK_POS_RIGHT</property>
+ <property name="digits">0</property>
+ <property name="update_policy">GTK_UPDATE_DELAYED</property>
+ <property name="inverted">False</property>
+ <property name="adjustment">0 0 100 1 1 0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
</glade-interface>
diff --git a/src/zenity.h b/src/zenity.h
index b224abd9..6b8cd294 100644
--- a/src/zenity.h
+++ b/src/zenity.h
@@ -61,6 +61,15 @@ typedef struct {
} ZenityMsgData;
typedef struct {
+ gchar *dialog_text;
+ gint value;
+ gint min_value;
+ gint max_value;
+ gint step;
+ gboolean print_partial;
+} ZenityScaleData;
+
+typedef struct {
gchar *uri;
gboolean multi;
gboolean directory;
bgstack15