diff options
Diffstat (limited to 'mate-screenshot')
-rw-r--r-- | mate-screenshot/data/Makefile.am | 11 | ||||
-rw-r--r-- | mate-screenshot/data/mate-screenshot.ui | 205 | ||||
-rw-r--r-- | mate-screenshot/src/mate-screenshot.c | 46 | ||||
-rw-r--r-- | mate-screenshot/src/screenshot-dialog.c | 12 | ||||
-rw-r--r-- | mate-screenshot/src/screenshot-dialog.h | 1 | ||||
-rw-r--r-- | mate-screenshot/src/screenshot-save.c | 1 | ||||
-rw-r--r-- | mate-screenshot/src/screenshot-save.h | 1 | ||||
-rw-r--r-- | mate-screenshot/src/screenshot-shadow.c | 1 | ||||
-rw-r--r-- | mate-screenshot/src/screenshot-shadow.h | 1 | ||||
-rw-r--r-- | mate-screenshot/src/screenshot-utils.c | 2 | ||||
-rw-r--r-- | mate-screenshot/src/screenshot-utils.h | 1 | ||||
-rw-r--r-- | mate-screenshot/src/screenshot-xfer.c | 1 | ||||
-rw-r--r-- | mate-screenshot/src/screenshot-xfer.h | 1 |
13 files changed, 145 insertions, 139 deletions
diff --git a/mate-screenshot/data/Makefile.am b/mate-screenshot/data/Makefile.am index d5603539..4f54db85 100644 --- a/mate-screenshot/data/Makefile.am +++ b/mate-screenshot/data/Makefile.am @@ -16,8 +16,13 @@ mate_screenshotdir = $(datadir)/applications mate_screenshot_in_files = mate-screenshot.desktop.in mate_screenshot_DATA = $(mate_screenshot_in_files:.desktop.in=.desktop) + $(mate_screenshot_DATA): $(mate_screenshot_in_files) - $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ +if USE_NLS + $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Name --keyword=Comment --keyword=Keywords --template $< -d $(top_srcdir)/po -o $@ +else + $(AM_V_GEN) cp $< $@ +endif man_MANS = mate-screenshot.1 @@ -25,7 +30,11 @@ appdatadir = $(datadir)/metainfo appdata_in_files = mate-screenshot.appdata.xml.in appdata_DATA = $(appdata_in_files:.xml.in=.xml) $(appdata_DATA): $(appdata_in_files) +if USE_NLS $(AM_V_GEN) $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@ +else + $(AM_V_GEN) cp $< $@ +endif gsettings_SCHEMAS = org.mate.screenshot.gschema.xml @GSETTINGS_RULES@ diff --git a/mate-screenshot/data/mate-screenshot.ui b/mate-screenshot/data/mate-screenshot.ui index a350face..46d0636c 100644 --- a/mate-screenshot/data/mate-screenshot.ui +++ b/mate-screenshot/data/mate-screenshot.ui @@ -1,64 +1,51 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 --> +<!-- Generated with glade 3.38.2 --> <!--*- mode: xml -*--> <interface> <requires lib="gtk+" version="3.22"/> <object class="GtkImage" id="image_cancel"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">process-stop</property> + <property name="can-focus">False</property> + <property name="icon-name">process-stop</property> </object> <object class="GtkImage" id="image_copy"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">edit-copy</property> + <property name="can-focus">False</property> + <property name="icon-name">edit-copy</property> </object> <object class="GtkImage" id="image_help"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">help-browser</property> - </object> - <object class="GtkImage" id="image_new"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">document-new</property> - </object> - <object class="GtkImage" id="image_save"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">document-save</property> + <property name="can-focus">False</property> + <property name="icon-name">help-browser</property> </object> <object class="GtkDialog" id="toplevel"> - <property name="can_focus">False</property> - <property name="border_width">5</property> + <property name="can-focus">False</property> + <property name="border-width">5</property> <property name="title" translatable="yes">Save Screenshot</property> <property name="resizable">False</property> - <property name="type_hint">dialog</property> + <property name="type-hint">dialog</property> <signal name="key-press-event" handler="on_toplevel_key_press_event" swapped="no"/> - <child> - <placeholder/> - </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">2</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> + <property name="can-focus">False</property> + <property name="layout-style">end</property> <child> <object class="GtkButton" id="help_button"> <property name="label" translatable="yes">_Help</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="receives-default">False</property> <property name="image">image_help</property> - <property name="use_underline">True</property> - <property name="always_show_image">True</property> + <property name="use-underline">True</property> + <property name="always-show-image">True</property> </object> <packing> <property name="expand">False</property> @@ -67,71 +54,71 @@ </packing> </child> <child> + <object class="GtkButton" id="new_button"> + <property name="label" translatable="yes">_New</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="receives-default">False</property> + <property name="image">image_new</property> + <property name="use-underline">True</property> + <property name="always-show-image">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> <object class="GtkButton" id="copy_button"> <property name="label" translatable="yes">C_opy to Clipboard</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="receives-default">False</property> <property name="image">image_copy</property> - <property name="use_underline">True</property> - <property name="always_show_image">True</property> + <property name="use-underline">True</property> + <property name="always-show-image">True</property> <accelerator key="C" signal="activate" modifiers="GDK_CONTROL_MASK"/> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> <object class="GtkButton" id="cancel_button"> <property name="label" translatable="yes">_Cancel</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="receives-default">False</property> <property name="image">image_cancel</property> - <property name="use_underline">True</property> - <property name="always_show_image">True</property> + <property name="use-underline">True</property> + <property name="always-show-image">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> <child> <object class="GtkButton" id="ok_button"> <property name="label" translatable="yes">_Save</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">False</property> <property name="image">image_save</property> - <property name="use_underline">True</property> - <property name="always_show_image">True</property> + <property name="use-underline">True</property> + <property name="always-show-image">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkButton" id="new_button"> - <property name="label" translatable="yes">_New</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="image">image_new</property> - <property name="use_underline">True</property> - <property name="always_show_image">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> <property name="position">4</property> </packing> </child> @@ -139,35 +126,35 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="pack_type">end</property> + <property name="pack-type">end</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkBox" id="vbox3"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="border_width">5</property> + <property name="can-focus">False</property> + <property name="border-width">5</property> <property name="orientation">vertical</property> <property name="spacing">18</property> <child> <object class="GtkBox" id="hbox6"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="spacing">12</property> <child> <object class="GtkAspectFrame" id="aspect_frame"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0</property> - <property name="shadow_type">in</property> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="label-yalign">0</property> + <property name="shadow-type">in</property> <property name="xalign">0</property> <property name="yalign">0</property> <child> <object class="GtkDrawingArea" id="preview_darea"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> </object> </child> </object> @@ -178,64 +165,80 @@ </packing> </child> <child> + <!-- n-columns=3 n-rows=3 --> <object class="GtkGrid" id="table1"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> + <property name="can-focus">False</property> + <property name="row-spacing">6</property> + <property name="column-spacing">12</property> <child> <object class="GtkLabel" id="label1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes">_Name:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">filename_entry</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">filename_entry</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkLabel" id="label3"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes">Save in _folder:</property> - <property name="use_underline">True</property> + <property name="use-underline">True</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="left-attach">0</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkEntry" id="filename_entry"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">True</property> - <property name="width_chars">32</property> + <property name="can-focus">True</property> + <property name="invisible-char">*</property> + <property name="activates-default">True</property> + <property name="width-chars">32</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="left-attach">1</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkBox" id="file_chooser_box"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <child> <placeholder/> </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="left-attach">1</property> + <property name="top-attach">1</property> </packing> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="expand">True</property> @@ -261,10 +264,20 @@ </child> <action-widgets> <action-widget response="-11">help_button</action-widget> + <action-widget response="22">new_button</action-widget> <action-widget response="1">copy_button</action-widget> <action-widget response="-6">cancel_button</action-widget> <action-widget response="-5">ok_button</action-widget> - <action-widget response="22">new_button</action-widget> </action-widgets> </object> + <object class="GtkImage" id="image_new"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">document-new</property> + </object> + <object class="GtkImage" id="image_save"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">document-save</property> + </object> </interface> diff --git a/mate-screenshot/src/mate-screenshot.c b/mate-screenshot/src/mate-screenshot.c index c888d4d7..9786c994 100644 --- a/mate-screenshot/src/mate-screenshot.c +++ b/mate-screenshot/src/mate-screenshot.c @@ -1,6 +1,7 @@ /* Copyright (C) 2001 Jonathan Blandford <[email protected]> * Copyright (C) 2006 Emmanuele Bassi <[email protected]> * Copyright (C) 2008 Cosimo Cecchi <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This file is part of MATE Utils. * @@ -31,7 +32,9 @@ #include <unistd.h> #include <stdlib.h> #include <errno.h> +#ifdef ENABLE_NLS #include <locale.h> +#endif /* ENABLE_NLS */ #include <glib/gi18n.h> #include <gio/gio.h> #include <pwd.h> @@ -537,7 +540,7 @@ create_interactive_dialog (void) G_CALLBACK (interactive_dialog_response_cb), NULL); - g_signal_connect (G_OBJECT (retval), "key-press-event", + g_signal_connect (retval, "key-press-event", G_CALLBACK(key_press_cb), NULL); @@ -757,7 +760,6 @@ screenshot_dialog_response_cb (GtkDialog *d, } } - static void run_dialog (ScreenshotDialog *dialog) { @@ -1110,7 +1112,6 @@ prepare_screenshot_timeout (gpointer data) return FALSE; } - static gchar * get_desktop_dir (void) { @@ -1177,8 +1178,10 @@ load_options (void) /* Find various dirs */ last_save_dir = g_settings_get_string (settings, LAST_SAVE_DIRECTORY_KEY); - if (!last_save_dir || !last_save_dir[0]) + + if (*last_save_dir == '\0') { + g_free (last_save_dir); last_save_dir = get_desktop_dir (); } else if (last_save_dir[0] == '~') @@ -1214,36 +1217,6 @@ save_options (void) BORDER_EFFECT_KEY, border_effect); } - -static void -register_screenshooter_icon (GtkIconFactory * factory) -{ - GtkIconSource *source; - GtkIconSet *icon_set; - - source = gtk_icon_source_new (); - gtk_icon_source_set_icon_name (source, SCREENSHOOTER_ICON); - - icon_set = gtk_icon_set_new (); - gtk_icon_set_add_source (icon_set, source); - - gtk_icon_factory_add (factory, SCREENSHOOTER_ICON, icon_set); - gtk_icon_set_unref (icon_set); - gtk_icon_source_free (source); -} - -static void -screenshooter_init_stock_icons (void) -{ - GtkIconFactory *factory; - - factory = gtk_icon_factory_new (); - gtk_icon_factory_add_default (factory); - - register_screenshooter_icon (factory); - g_object_unref (factory); -} - void loop_dialog_screenshot (void) { @@ -1318,13 +1291,15 @@ main (int argc, char *argv[]) { "border-effect", 'e', 0, G_OPTION_ARG_STRING, &border_effect_arg, N_("Effect to add to the border (shadow, border or none)"), N_("effect") }, { "interactive", 'i', 0, G_OPTION_ARG_NONE, &interactive_arg, N_("Interactively set options"), NULL }, { "version", 0, 0, G_OPTION_ARG_NONE, &version_arg, N_("Print version information and exit"), NULL }, - { NULL }, + { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }, }; +#ifdef ENABLE_NLS setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); +#endif /* ENABLE_NLS */ context = g_option_context_new (_("Take a picture of the screen")); g_option_context_set_ignore_unknown_options (context, FALSE); @@ -1361,7 +1336,6 @@ main (int argc, char *argv[]) } gtk_window_set_default_icon_name (SCREENSHOOTER_ICON); - screenshooter_init_stock_icons (); settings = g_settings_new (MATE_SCREENSHOT_SCHEMA); load_options (); diff --git a/mate-screenshot/src/screenshot-dialog.c b/mate-screenshot/src/screenshot-dialog.c index 40ce7125..cd1afeb2 100644 --- a/mate-screenshot/src/screenshot-dialog.c +++ b/mate-screenshot/src/screenshot-dialog.c @@ -1,4 +1,5 @@ /* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This file is part of MATE Utils. * @@ -166,7 +167,6 @@ drag_begin (GtkWidget *widget, dialog->drag_x, dialog->drag_y); } - ScreenshotDialog * screenshot_dialog_new (GdkPixbuf *screenshot, char *initial_uri, @@ -253,10 +253,12 @@ screenshot_dialog_new (GdkPixbuf *screenshot, gtk_frame_set_shadow_type (GTK_FRAME (aspect_frame), GTK_SHADOW_IN); /* setup dnd */ - g_signal_connect (G_OBJECT (preview_darea), "drag_begin", - G_CALLBACK (drag_begin), dialog); - g_signal_connect (G_OBJECT (preview_darea), "drag_data_get", - G_CALLBACK (drag_data_get), dialog); + g_signal_connect (preview_darea, "drag_begin", + G_CALLBACK (drag_begin), + dialog); + g_signal_connect (preview_darea, "drag_data_get", + G_CALLBACK (drag_data_get), + dialog); gtk_widget_show_all (toplevel); diff --git a/mate-screenshot/src/screenshot-dialog.h b/mate-screenshot/src/screenshot-dialog.h index cf2a8186..40108a31 100644 --- a/mate-screenshot/src/screenshot-dialog.h +++ b/mate-screenshot/src/screenshot-dialog.h @@ -1,4 +1,5 @@ /* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This file is part of MATE Utils. * diff --git a/mate-screenshot/src/screenshot-save.c b/mate-screenshot/src/screenshot-save.c index 59b455c4..1acf898f 100644 --- a/mate-screenshot/src/screenshot-save.c +++ b/mate-screenshot/src/screenshot-save.c @@ -1,4 +1,5 @@ /* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This file is part of MATE Utils. * diff --git a/mate-screenshot/src/screenshot-save.h b/mate-screenshot/src/screenshot-save.h index 0b12b8ad..3db39631 100644 --- a/mate-screenshot/src/screenshot-save.h +++ b/mate-screenshot/src/screenshot-save.h @@ -1,4 +1,5 @@ /* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This file is part of MATE Utils. * diff --git a/mate-screenshot/src/screenshot-shadow.c b/mate-screenshot/src/screenshot-shadow.c index cecdfd4a..dfef5edf 100644 --- a/mate-screenshot/src/screenshot-shadow.c +++ b/mate-screenshot/src/screenshot-shadow.c @@ -1,4 +1,5 @@ /* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This file is part of MATE Utils. * diff --git a/mate-screenshot/src/screenshot-shadow.h b/mate-screenshot/src/screenshot-shadow.h index 1b31e564..16c16e3a 100644 --- a/mate-screenshot/src/screenshot-shadow.h +++ b/mate-screenshot/src/screenshot-shadow.h @@ -1,4 +1,5 @@ /* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This file is part of MATE Utils. * diff --git a/mate-screenshot/src/screenshot-utils.c b/mate-screenshot/src/screenshot-utils.c index 568c24c7..6ee457c9 100644 --- a/mate-screenshot/src/screenshot-utils.c +++ b/mate-screenshot/src/screenshot-utils.c @@ -1,5 +1,6 @@ /* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> * Copyright (C) 2008 Cosimo Cecchi <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This file is part of MATE Utils. * @@ -313,7 +314,6 @@ select_area_key_press (GtkWidget *window, return TRUE; } - static gboolean draw (GtkWidget *window, cairo_t *cr, gpointer unused) { diff --git a/mate-screenshot/src/screenshot-utils.h b/mate-screenshot/src/screenshot-utils.h index 1a63ae85..0b7e5700 100644 --- a/mate-screenshot/src/screenshot-utils.h +++ b/mate-screenshot/src/screenshot-utils.h @@ -1,4 +1,5 @@ /* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This file is part of MATE Utils. * diff --git a/mate-screenshot/src/screenshot-xfer.c b/mate-screenshot/src/screenshot-xfer.c index 4bb1dda2..66aff329 100644 --- a/mate-screenshot/src/screenshot-xfer.c +++ b/mate-screenshot/src/screenshot-xfer.c @@ -1,5 +1,6 @@ /* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> * Copyright (C) 2008 Cosimo Cecchi <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This file is part of MATE Utils. * diff --git a/mate-screenshot/src/screenshot-xfer.h b/mate-screenshot/src/screenshot-xfer.h index 0d172c29..df4a6bb2 100644 --- a/mate-screenshot/src/screenshot-xfer.h +++ b/mate-screenshot/src/screenshot-xfer.h @@ -1,5 +1,6 @@ /* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> * Copyright (C) 2008 Cosimo Cecchi <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * * This file is part of MATE Utils. * |