~ubuntu-branches/ubuntu/lucid/awn-extras-applets/lucid

« back to all changes in this revision

Viewing changes to applets/maintained/awnterm/awn-terminal.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-03-30 20:26:40 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100330202640-vza3bdnv9gc9bg5z
Tags: 0.4.0~rc1-0ubuntu1
* New upstream release (rc1) (LP: #551309)
 - Stack applet close on click (LP: #261520)
* debian/patches/
 - 03-remove-cairo-menu-pref.patch: From upstream (r1244 + r1245 + r1252),
   remove menu entry for cairo-menu preferences, it's not implemented
   (LP: #511254)
 - 04-tomboy-threading-free.patch: From upstream (r1246), remove threading to
   make the applet working. 
* debian/*.install: Update installation location of comics and digital 
  applets.
* debian/control: 
 - Move digital applet from python to C, and add proper Replaces.
 - Add Replaces for awn-applets-c-core to handle migration from 0.3.2.2.
   (LP: #524559)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <glib.h>
24
24
#include <glib-object.h>
25
25
#include <config.h>
 
26
#include <stdlib.h>
 
27
#include <string.h>
26
28
#include <dbus/dbus-glib-lowlevel.h>
27
29
#include <dbus/dbus-glib.h>
28
30
#include <libawn/libawn.h>
30
32
#include <gtk/gtk.h>
31
33
#include <float.h>
32
34
#include <math.h>
33
 
#include <stdlib.h>
34
 
#include <string.h>
35
35
#include <gdk/gdk.h>
36
36
#include <vte/vte.h>
37
37
#include <glib/gi18n-lib.h>
38
38
#include <eggaccelerators.h>
39
39
#include <gdk-pixbuf/gdk-pixdata.h>
40
40
#include <keybinder.h>
41
 
#include <locale.h>
42
41
#include <glib/gi18n.h>
43
42
#include <dbus/dbus.h>
44
43
 
616
615
                }
617
616
                g_set_error_literal (error, _edomain, _ecode, _dbus_error.message);
618
617
                dbus_error_free (&_dbus_error);
 
618
                return;
619
619
        }
620
620
        if (strcmp (dbus_message_get_signature (_reply), "")) {
621
621
                g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_SIGNATURE, "Invalid signature, expected \"%s\", got \"%s\"", "", dbus_message_get_signature (_reply));
661
661
        g_value_set_int (&__params_it->value, panel_id);
662
662
        __params_it++;
663
663
        self = g_object_newv (object_type, __params_it - __params, __params);
664
 
        g_object_set ((AwnApplet*) self, "display-name", "Awn Terminal Applet", NULL);
 
664
        g_object_set ((AwnApplet*) self, "display-name", "Terminal", NULL);
665
665
        while (__params_it > __params) {
666
666
                --__params_it;
667
667
                g_value_unset (&__params_it->value);
755
755
                        if (_inner_error_->domain == DESKTOP_AGNOSTIC_CONFIG_ERROR) {
756
756
                                goto __catch0_desktop_agnostic_config_error;
757
757
                        }
758
 
                        goto __finally0;
 
758
                        _g_object_unref0 (box);
 
759
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
760
                        g_clear_error (&_inner_error_);
 
761
                        return;
759
762
                }
760
763
                desktop_agnostic_config_client_bind (self->priv->config, DESKTOP_AGNOSTIC_CONFIG_GROUP_DEFAULT, "hide_on_unfocus", (GObject*) self, "hide-on-unfocus", FALSE, DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK, &_inner_error_);
761
764
                if (_inner_error_ != NULL) {
762
765
                        if (_inner_error_->domain == DESKTOP_AGNOSTIC_CONFIG_ERROR) {
763
766
                                goto __catch0_desktop_agnostic_config_error;
764
767
                        }
765
 
                        goto __finally0;
 
768
                        _g_object_unref0 (box);
 
769
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
770
                        g_clear_error (&_inner_error_);
 
771
                        return;
766
772
                }
767
773
                desktop_agnostic_config_client_bind (self->priv->config, DESKTOP_AGNOSTIC_CONFIG_GROUP_DEFAULT, "global_hotkey", (GObject*) self, "keybinding", FALSE, DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK, &_inner_error_);
768
774
                if (_inner_error_ != NULL) {
769
775
                        if (_inner_error_->domain == DESKTOP_AGNOSTIC_CONFIG_ERROR) {
770
776
                                goto __catch0_desktop_agnostic_config_error;
771
777
                        }
772
 
                        goto __finally0;
 
778
                        _g_object_unref0 (box);
 
779
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
780
                        g_clear_error (&_inner_error_);
 
781
                        return;
773
782
                }
774
783
                desktop_agnostic_config_client_bind (self->priv->config, DESKTOP_AGNOSTIC_CONFIG_GROUP_DEFAULT, "bg_img", (GObject*) self, "background-image", FALSE, DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK, &_inner_error_);
775
784
                if (_inner_error_ != NULL) {
776
785
                        if (_inner_error_->domain == DESKTOP_AGNOSTIC_CONFIG_ERROR) {
777
786
                                goto __catch0_desktop_agnostic_config_error;
778
787
                        }
779
 
                        goto __finally0;
 
788
                        _g_object_unref0 (box);
 
789
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
790
                        g_clear_error (&_inner_error_);
 
791
                        return;
780
792
                }
781
793
                desktop_agnostic_config_client_bind (self->priv->config, DESKTOP_AGNOSTIC_CONFIG_GROUP_DEFAULT, "main_terminal", (GObject*) self, "terminal-command", FALSE, DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK, &_inner_error_);
782
794
                if (_inner_error_ != NULL) {
783
795
                        if (_inner_error_->domain == DESKTOP_AGNOSTIC_CONFIG_ERROR) {
784
796
                                goto __catch0_desktop_agnostic_config_error;
785
797
                        }
786
 
                        goto __finally0;
 
798
                        _g_object_unref0 (box);
 
799
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
800
                        g_clear_error (&_inner_error_);
 
801
                        return;
787
802
                }
788
803
        }
789
804
        goto __finally0;
918
933
                gdk_spawn_command_line_on_screen (gtk_window_get_screen ((GtkWindow*) self), terminal, &_inner_error_);
919
934
                if (_inner_error_ != NULL) {
920
935
                        goto __catch1_g_error;
921
 
                        goto __finally1;
922
936
                }
923
937
        }
924
938
        goto __finally1;
1135
1149
                pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, &_inner_error_);
1136
1150
                if (_inner_error_ != NULL) {
1137
1151
                        goto __catch2_g_error;
1138
 
                        goto __finally2;
1139
1152
                }
1140
1153
                gtk_image_set_from_pixbuf (self->priv->preview_image, pixbuf);
1141
1154
                gtk_file_chooser_set_preview_widget_active (w, TRUE);
1194
1207
        GtkWidget* _tmp0_;
1195
1208
        g_return_val_if_fail (w != NULL, FALSE);
1196
1209
        awn_terminal_applet_set_terminal_command (self, gtk_entry_get_text ((_tmp0_ = w, GTK_IS_ENTRY (_tmp0_) ? ((GtkEntry*) _tmp0_) : NULL)));
 
1210
        result = FALSE;
 
1211
        return result;
1197
1212
}
1198
1213
 
1199
1214
 
1739
1754
        g_return_val_if_fail (canonical_name != NULL, NULL);
1740
1755
        g_return_val_if_fail (uid != NULL, NULL);
1741
1756
        _inner_error_ = NULL;
1742
 
        setlocale (LC_ALL, "");
1743
1757
        bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
1744
1758
        textdomain (GETTEXT_PACKAGE);
1745
1759
        conn = dbus_g_bus_get (DBUS_BUS_SESSION, &_inner_error_);