~ubuntu-branches/ubuntu/oneiric/gnome-panel/oneiric

« back to all changes in this revision

Viewing changes to gnome-panel/panel-run-dialog.c

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Bicha
  • Date: 2011-08-17 21:57:14 UTC
  • mfrom: (1.13.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20110817215714-mr18pl4hqedmprd7
Tags: 1:3.1.5-0ubuntu1
* New upstream release.
* debian/control: Bump gnome-menus dependencies
* debian/libpanel-applet-4-dev.install: No longer any *.a files to install
* debian/patches/09_default_icons.patch: Disabled until it can be ported
* debian/patches/90_build_fixes.patch: Dropped, applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
 
1
/* -*- c-basic-offset: 8; indent-tabs-mode: t -*-
2
2
 * panel-run-dialog.c:
3
3
 *
4
4
 * Copyright (C) 2003 Frank Worsley <fworsley@shaw.ca>
49
49
#include <libpanel-util/panel-gtk.h>
50
50
#include <libpanel-util/panel-keyfile.h>
51
51
#include <libpanel-util/panel-show.h>
 
52
#include <libpanel-util/panel-xdg.h>
52
53
 
53
54
#include "nothing.h"
54
55
#include "panel-util.h"
88
89
        GCompletion      *completion;
89
90
        
90
91
        GSList           *add_icon_paths;
91
 
        int               add_icons_idle_id;
92
92
        int               add_items_idle_id;
93
93
        int               find_command_idle_id;
94
94
        gboolean          use_program_list;
95
95
        gboolean          completion_started;
96
96
        
97
 
        char             *icon_path;
 
97
        GIcon            *gicon;
98
98
        char             *desktop_path;
99
99
        char             *item_name;    
100
100
} PanelRunDialog;
101
101
 
102
102
enum {
103
103
        COLUMN_ICON,
104
 
        COLUMN_ICON_FILE,
105
104
        COLUMN_NAME,
106
105
        COLUMN_COMMENT,
107
106
        COLUMN_PATH,
112
111
 
113
112
static PanelRunDialog *static_dialog = NULL;
114
113
 
115
 
static void panel_run_dialog_disconnect_pixmap (PanelRunDialog *dialog);
116
 
 
117
114
#define PANEL_RUN_MAX_HISTORY 20
118
115
 
119
116
static GtkTreeModel *
187
184
        g_slist_free (dialog->add_icon_paths);
188
185
        dialog->add_icon_paths = NULL;
189
186
 
190
 
        g_free (dialog->icon_path);
191
 
        dialog->icon_path = NULL;
 
187
        if (dialog->gicon)
 
188
                g_object_unref (dialog->gicon);
 
189
        dialog->gicon = NULL;
 
190
 
192
191
        g_free (dialog->desktop_path);
193
192
        dialog->desktop_path = NULL;
194
193
        g_free (dialog->item_name);
195
194
        dialog->item_name = NULL;
196
195
 
197
 
        if (dialog->add_icons_idle_id)
198
 
                g_source_remove (dialog->add_icons_idle_id);
199
 
        dialog->add_icons_idle_id = 0;
200
 
 
201
196
        if (dialog->add_items_idle_id)
202
197
                g_source_remove (dialog->add_items_idle_id);
203
198
        dialog->add_items_idle_id = 0;
224
219
                g_completion_free (dialog->completion);
225
220
        dialog->completion = NULL;
226
221
 
227
 
        panel_run_dialog_disconnect_pixmap (dialog);
228
 
 
229
222
        if (dialog->run_settings)
230
223
                g_object_unref (dialog->run_settings);
231
224
        dialog->run_settings = NULL;
250
243
                                      PANEL_ICON_RUN,
251
244
                                      GTK_ICON_SIZE_DIALOG);
252
245
        
253
 
        gtk_window_set_icon_name (GTK_WINDOW (dialog->run_dialog),
254
 
                                  PANEL_ICON_RUN);
255
 
 
256
246
        if (set_drag)
257
247
                gtk_drag_source_set_icon_name (dialog->run_dialog,
258
248
                                               PANEL_ICON_LAUNCHER);
260
250
 
261
251
static void
262
252
panel_run_dialog_set_icon (PanelRunDialog *dialog,
263
 
                           const char     *icon_path,
 
253
                           GIcon          *gicon,
264
254
                           gboolean        force)
265
255
{
266
 
        GdkPixbuf *pixbuf = NULL;
267
 
 
268
 
        if (!force && icon_path && dialog->icon_path &&
269
 
            !strcmp (icon_path, dialog->icon_path))
 
256
        if (!force && gicon && dialog->gicon &&
 
257
            gicon == dialog->gicon)
270
258
                return;
271
259
 
272
 
        g_free (dialog->icon_path);
273
 
        dialog->icon_path = NULL;
274
 
                
275
 
        if (icon_path) {
276
 
                GdkScreen   *screen;
277
 
                GtkSettings *settings;
278
 
                int          size;
279
 
 
280
 
                screen = gtk_widget_get_screen (GTK_WIDGET (dialog->pixmap));
281
 
                settings = gtk_settings_get_for_screen (screen);
282
 
                gtk_icon_size_lookup_for_settings (settings,
283
 
                                                   GTK_ICON_SIZE_DIALOG,
284
 
                                                   &size, NULL);
285
 
 
286
 
                pixbuf = panel_load_icon (gtk_icon_theme_get_default (),
287
 
                                          icon_path,
288
 
                                          size,
289
 
                                          size,
290
 
                                          size,
291
 
                                          NULL);
292
 
        }
293
 
        
294
 
        if (pixbuf) {
295
 
                dialog->icon_path = g_strdup (icon_path);
296
 
 
297
 
                /* Don't bother scaling the image if it's too small.
298
 
                 * Scaled looks worse than a smaller image.
299
 
                 */
300
 
                gtk_image_set_from_pixbuf (GTK_IMAGE (dialog->pixmap), pixbuf);
301
 
 
302
 
                //FIXME: it'd be better to set an icon of the correct size,
303
 
                //(ditto for the drag icon?)
304
 
                gtk_window_set_icon (GTK_WINDOW (dialog->run_dialog), pixbuf);
305
 
                
306
 
                gtk_drag_source_set_icon_pixbuf (dialog->run_dialog, pixbuf);
307
 
                g_object_unref (pixbuf);
 
260
        if (dialog->gicon)
 
261
                g_object_unref (dialog->gicon);
 
262
        dialog->gicon = NULL;
 
263
                
 
264
        if (gicon) {
 
265
                dialog->gicon = g_object_ref (gicon);
 
266
                gtk_image_set_from_gicon (GTK_IMAGE (dialog->pixmap),
 
267
                                          gicon, GTK_ICON_SIZE_DIALOG);
 
268
                gtk_drag_source_set_icon_gicon (dialog->run_dialog, gicon);
308
269
        } else {
309
270
                panel_run_dialog_set_default_icon (dialog, TRUE);
310
271
        }
649
610
        GtkTreeModel *model;
650
611
        GtkTreePath  *path;
651
612
        char         *text;
652
 
        char         *found_icon;
 
613
        GIcon        *found_icon;
653
614
        char         *found_name;
654
615
        gboolean      fuzzy;
655
616
        
673
634
 
674
635
        do {
675
636
                char *exec = NULL;
676
 
                char *icon = NULL;
677
637
                char *name = NULL;
678
638
                char *comment = NULL;
 
639
                GIcon *icon = NULL;
679
640
 
680
641
                gtk_tree_model_get (model, &iter,
681
 
                                    COLUMN_EXEC,      &exec,
682
 
                                    COLUMN_ICON_FILE, &icon,
683
 
                                    COLUMN_NAME,      &name,
684
 
                                    COLUMN_COMMENT,   &comment,
 
642
                                    COLUMN_EXEC,    &exec,
 
643
                                    COLUMN_ICON,    &icon,
 
644
                                    COLUMN_NAME,    &name,
 
645
                                    COLUMN_COMMENT, &comment,
685
646
                                    -1);
686
647
 
687
648
                if (!fuzzy && exec && icon &&
688
649
                    fuzzy_command_match (text, exec, &fuzzy)) {
689
 
                        g_free (found_icon);
 
650
                        if (found_icon)
 
651
                                g_object_unref (found_icon);
690
652
                        g_free (found_name);
691
653
                        
692
 
                        found_icon = g_strdup (icon);
 
654
                        found_icon = g_object_ref (icon);
693
655
                        found_name = g_strdup (name);
694
656
                        
695
657
                        gtk_list_store_set (dialog->program_list_store,
711
673
                }
712
674
 
713
675
                g_free (exec);
714
 
                g_free (icon);
 
676
                g_object_unref (icon);
715
677
                g_free (name);
716
678
                g_free (comment);
717
679
        
727
689
        panel_run_dialog_set_icon (dialog, found_icon, FALSE);
728
690
        //FIXME update dialog->program_label
729
691
 
730
 
        g_free (found_icon);
 
692
        if (found_icon)
 
693
                g_object_unref (found_icon);
731
694
        g_free (text);
732
695
        
733
696
        g_free (dialog->item_name);
737
700
        return FALSE;
738
701
}
739
702
 
740
 
static gboolean
741
 
panel_run_dialog_add_icon_idle (PanelRunDialog *dialog)
742
 
{
743
 
        GtkTreeIter  iter;
744
 
        GtkTreePath *path;
745
 
        GdkPixbuf   *pixbuf;
746
 
        char        *file;
747
 
        int          icon_height;
748
 
        gboolean     long_operation = FALSE;
749
 
        
750
 
        do {
751
 
                if (!dialog->add_icon_paths) {
752
 
                        dialog->add_icons_idle_id = 0;
753
 
                        return FALSE;
754
 
                }
755
 
 
756
 
                path = dialog->add_icon_paths->data;
757
 
                dialog->add_icon_paths->data = NULL;
758
 
                dialog->add_icon_paths = g_slist_delete_link (dialog->add_icon_paths,
759
 
                                                              dialog->add_icon_paths);
760
 
 
761
 
                if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->program_list_store),
762
 
                                              &iter,
763
 
                                              path)) {
764
 
                        gtk_tree_path_free (path);
765
 
                        continue;
766
 
                }
767
 
                
768
 
                gtk_tree_path_free (path);
769
 
 
770
 
                gtk_tree_model_get (GTK_TREE_MODEL (dialog->program_list_store), &iter,
771
 
                                    COLUMN_ICON_FILE, &file, -1);
772
 
 
773
 
                if (!gtk_icon_size_lookup (panel_menu_icon_get_size (), NULL, &icon_height)) {
774
 
                        icon_height = PANEL_DEFAULT_MENU_ICON_SIZE;
775
 
                }
776
 
 
777
 
                pixbuf = panel_make_menu_icon (gtk_icon_theme_get_default (), file, NULL, icon_height, &long_operation);
778
 
                if (pixbuf) {
779
 
                        gtk_list_store_set (dialog->program_list_store, &iter, COLUMN_ICON, pixbuf, -1);
780
 
                        g_object_unref (pixbuf);
781
 
                }
782
 
                g_free (file);
783
 
                
784
 
        /* don't go back into the main loop if this wasn't very hard to do */
785
 
        } while (!long_operation);
786
 
 
787
 
        return TRUE;
788
 
}
789
 
 
790
703
static int
791
704
compare_applications (GMenuTreeEntry *a,
792
705
                      GMenuTreeEntry *b)
793
706
{
794
 
        return g_utf8_collate (gmenu_tree_entry_get_display_name (a),
795
 
                               gmenu_tree_entry_get_display_name (b));
 
707
        return g_utf8_collate (g_app_info_get_display_name ((GAppInfo*)(gmenu_tree_entry_get_app_info (a))),
 
708
                               g_app_info_get_display_name ((GAppInfo*)(gmenu_tree_entry_get_app_info (b))));
796
709
}
797
710
 
798
711
static GSList *get_all_applications_from_dir (GMenuTreeDirectory *directory,
802
715
get_all_applications_from_alias (GMenuTreeAlias *alias,
803
716
                                 GSList         *list)
804
717
{
805
 
        GMenuTreeItem *aliased_item;
806
 
 
807
 
        aliased_item = gmenu_tree_alias_get_item (alias);
808
 
 
809
 
        switch (gmenu_tree_item_get_type (aliased_item)) {
 
718
        switch (gmenu_tree_alias_get_aliased_item_type (alias)) {
810
719
        case GMENU_TREE_ITEM_ENTRY:
811
 
                list = g_slist_append (list, gmenu_tree_item_ref (aliased_item));
 
720
                /* pass on the reference */
 
721
                list = g_slist_append (list, gmenu_tree_alias_get_aliased_entry (alias));
812
722
                break;
813
723
 
814
 
        case GMENU_TREE_ITEM_DIRECTORY:
815
 
                list = get_all_applications_from_dir (GMENU_TREE_DIRECTORY (aliased_item),
816
 
                                                      list);
 
724
        case GMENU_TREE_ITEM_DIRECTORY: {
 
725
                GMenuTreeDirectory *directory = gmenu_tree_alias_get_aliased_directory (alias);
 
726
                list = get_all_applications_from_dir (directory, list);
 
727
                gmenu_tree_item_unref (directory);
817
728
                break;
 
729
        }
818
730
 
819
731
        default:
820
732
                break;
821
733
        }
822
734
 
823
 
        gmenu_tree_item_unref (aliased_item);
824
 
 
825
735
        return list;
826
736
}
827
737
 
829
739
get_all_applications_from_dir (GMenuTreeDirectory *directory,
830
740
                               GSList             *list)
831
741
{
832
 
        GSList *items;
833
 
        GSList *l;
834
 
 
835
 
        items = gmenu_tree_directory_get_contents (directory);
836
 
 
837
 
        for (l = items; l; l = l->next) {
838
 
                switch (gmenu_tree_item_get_type (l->data)) {
 
742
        GMenuTreeIter *iter;
 
743
        GMenuTreeItemType next_type;
 
744
 
 
745
        iter = gmenu_tree_directory_iter (directory);
 
746
 
 
747
        while ((next_type = gmenu_tree_iter_next (iter)) != GMENU_TREE_ITEM_INVALID) {
 
748
                switch (next_type) {
839
749
                case GMENU_TREE_ITEM_ENTRY:
840
 
                        list = g_slist_append (list, gmenu_tree_item_ref (l->data));
841
 
                        break;
842
 
 
843
 
                case GMENU_TREE_ITEM_DIRECTORY:
844
 
                        list = get_all_applications_from_dir (l->data, list);
845
 
                        break;
846
 
 
847
 
                case GMENU_TREE_ITEM_ALIAS:
848
 
                        list = get_all_applications_from_alias (l->data, list);
849
 
                        break;
 
750
                        list = g_slist_append (list, gmenu_tree_iter_get_entry (iter));
 
751
                        break;
 
752
 
 
753
                case GMENU_TREE_ITEM_DIRECTORY: {
 
754
                        GMenuTreeDirectory *dir = gmenu_tree_iter_get_directory (iter);
 
755
                        list = get_all_applications_from_dir (dir, list);
 
756
                        gmenu_tree_item_unref (dir);
 
757
                        break;
 
758
                }
 
759
 
 
760
                case GMENU_TREE_ITEM_ALIAS: {
 
761
                        GMenuTreeAlias *alias = gmenu_tree_iter_get_alias (iter);
 
762
                        list = get_all_applications_from_alias (alias, list);
 
763
                        gmenu_tree_item_unref (alias);
 
764
                        break;
 
765
                }
850
766
 
851
767
                default:
852
768
                        break;
853
769
                }
854
 
 
855
 
                gmenu_tree_item_unref (l->data);
856
770
        }
857
771
 
858
 
        g_slist_free (items);
 
772
        gmenu_tree_iter_unref (iter);
859
773
 
860
774
        return list;
861
775
}
867
781
        GMenuTreeDirectory *root;
868
782
        GSList             *retval;
869
783
 
870
 
        tree = gmenu_tree_lookup ("applications.menu", GMENU_TREE_FLAGS_NONE);
871
 
        gmenu_tree_set_sort_key (tree, GMENU_TREE_SORT_DISPLAY_NAME);
 
784
        tree = gmenu_tree_new ("applications.menu", GMENU_TREE_FLAGS_SORT_DISPLAY_NAME);
 
785
 
 
786
        if (!gmenu_tree_load_sync (tree, NULL))
 
787
                return NULL;
872
788
 
873
789
        root = gmenu_tree_get_root_directory (tree);
874
790
 
875
791
        retval = get_all_applications_from_dir (root, NULL);
876
792
 
877
793
        gmenu_tree_item_unref (root);
878
 
        gmenu_tree_unref (tree);
 
794
        g_object_unref (tree);
879
795
 
880
796
        retval = g_slist_sort (retval,
881
797
                               (GCompareFunc) compare_applications);
896
812
 
897
813
        /* create list store */
898
814
        dialog->program_list_store = gtk_list_store_new (NUM_COLUMNS,
899
 
                                                         GDK_TYPE_PIXBUF,
900
 
                                                         G_TYPE_STRING,
 
815
                                                         G_TYPE_ICON,
901
816
                                                         G_TYPE_STRING,
902
817
                                                         G_TYPE_STRING,
903
818
                                                         G_TYPE_STRING,
909
824
        /* Strip duplicates */
910
825
        prev_name = NULL;
911
826
        for (l = all_applications; l; l = next) {
912
 
                GMenuTreeEntry *entry = l->data;
913
 
                const char     *entry_name;
 
827
                GMenuTreeEntry  *entry = l->data;
 
828
                const char      *entry_name;
 
829
                GDesktopAppInfo *app_info;
 
830
 
914
831
 
915
832
                next = l->next;
 
833
                app_info = gmenu_tree_entry_get_app_info (entry);
916
834
 
917
 
                entry_name = gmenu_tree_entry_get_display_name (entry);
 
835
                entry_name = g_app_info_get_display_name (G_APP_INFO (app_info));
918
836
                if (prev_name && entry_name && strcmp (entry_name, prev_name) == 0) {
919
837
                        gmenu_tree_item_unref (entry);
920
838
 
926
844
 
927
845
        for (l = all_applications; l; l = l->next) {
928
846
                GMenuTreeEntry *entry = l->data;
929
 
                GtkTreeIter    iter;
930
 
                GtkTreePath   *path;
 
847
                GtkTreeIter     iter;
 
848
                GtkTreePath    *path;
 
849
                GAppInfo       *app_info;
 
850
 
 
851
                app_info = G_APP_INFO (gmenu_tree_entry_get_app_info (entry));
931
852
 
932
853
                gtk_list_store_append (dialog->program_list_store, &iter);
933
854
                gtk_list_store_set (dialog->program_list_store, &iter,
934
 
                                    COLUMN_ICON,      NULL,
935
 
                                    COLUMN_ICON_FILE, gmenu_tree_entry_get_icon (entry),
936
 
                                    COLUMN_NAME,      gmenu_tree_entry_get_display_name (entry),
937
 
                                    COLUMN_COMMENT,   gmenu_tree_entry_get_comment (entry),
938
 
                                    COLUMN_EXEC,      gmenu_tree_entry_get_exec (entry),
939
 
                                    COLUMN_PATH,      gmenu_tree_entry_get_desktop_file_path (entry),
940
 
                                    COLUMN_VISIBLE,   TRUE,
 
855
                                    COLUMN_ICON,    g_app_info_get_icon (app_info),
 
856
                                    COLUMN_NAME,    g_app_info_get_display_name (app_info),
 
857
                                    COLUMN_COMMENT, g_app_info_get_description (app_info),
 
858
                                    COLUMN_EXEC,    g_app_info_get_executable (app_info),
 
859
                                    COLUMN_PATH,    gmenu_tree_entry_get_desktop_file_path (entry),
 
860
                                    COLUMN_VISIBLE, TRUE,
941
861
                                    -1);
942
862
 
943
863
                path = gtk_tree_model_get_path (GTK_TREE_MODEL (dialog->program_list_store), &iter);
963
883
        column = gtk_tree_view_column_new ();
964
884
        gtk_tree_view_column_pack_start (column, renderer, FALSE);
965
885
        gtk_tree_view_column_set_attributes (column, renderer,
966
 
                                             "pixbuf", COLUMN_ICON,
 
886
                                             "gicon", COLUMN_ICON,
967
887
                                             NULL);
968
888
        
969
889
        renderer = gtk_cell_renderer_text_new ();
976
896
 
977
897
        dialog->add_icon_paths = g_slist_reverse (dialog->add_icon_paths);
978
898
 
979
 
        if (!dialog->add_icons_idle_id)
980
 
                dialog->add_icons_idle_id =
981
 
                        g_idle_add_full (G_PRIORITY_LOW, (GSourceFunc) panel_run_dialog_add_icon_idle,
982
 
                                         dialog, NULL);
983
 
 
984
899
        dialog->add_items_idle_id = 0;                                   
985
900
        return FALSE;
986
901
}
1088
1003
        g_free (temp);
1089
1004
 
1090
1005
        temp = panel_key_file_get_locale_string (key_file, "Icon");
1091
 
        panel_run_dialog_set_icon (dialog, temp, FALSE);
 
1006
        if (!PANEL_GLIB_STR_EMPTY (temp)) {
 
1007
                GIcon *gicon;
 
1008
 
 
1009
                stripped = panel_xdg_icon_remove_extension (temp);
 
1010
                gicon = g_themed_icon_new (stripped);
 
1011
                panel_run_dialog_set_icon (dialog, gicon, FALSE);
 
1012
                g_object_unref (gicon);
 
1013
                g_free (stripped);
 
1014
        } else {
 
1015
                panel_run_dialog_set_icon (dialog, NULL, FALSE);
 
1016
        }
1092
1017
        g_free (temp);
1093
1018
        
1094
1019
        temp = panel_key_file_get_locale_string (key_file, "Comment");
1769
1694
        gboolean  exec = FALSE;
1770
1695
        char     *text;
1771
1696
        char     *name;
 
1697
        char     *icon;
1772
1698
        char     *disk;
1773
1699
        char     *scheme;
1774
1700
        char     *save_uri;
1815
1741
        panel_key_file_set_boolean (key_file, "Terminal",
1816
1742
                                    gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->terminal_checkbox)));
1817
1743
 
1818
 
        if (dialog->icon_path)
 
1744
        icon = NULL;
 
1745
        if (dialog->gicon)
 
1746
                icon = panel_util_get_icon_name_from_g_icon (dialog->gicon);
 
1747
        if (icon != NULL) {
1819
1748
                panel_key_file_set_locale_string (key_file, "Icon",
1820
 
                                                  dialog->icon_path);
1821
 
        else
 
1749
                                                  icon);
 
1750
                g_free (icon);
 
1751
        } else
1822
1752
                panel_key_file_set_locale_string (key_file, "Icon",
1823
1753
                                                  PANEL_ICON_LAUNCHER);
1824
1754
 
1862
1792
}
1863
1793
 
1864
1794
static void
1865
 
panel_run_dialog_style_updated (GtkWidget      *widget,
1866
 
                                PanelRunDialog *dialog)
1867
 
{
1868
 
  if (dialog->icon_path) {
1869
 
          char *icon_path;
1870
 
 
1871
 
          icon_path = g_strdup (dialog->icon_path);
1872
 
          panel_run_dialog_set_icon (dialog, icon_path, TRUE);
1873
 
          g_free (icon_path);
1874
 
  }
1875
 
}
1876
 
 
1877
 
static void
1878
 
panel_run_dialog_screen_changed (GtkWidget      *widget,
1879
 
                                 GdkScreen      *prev_screen,
1880
 
                                 PanelRunDialog *dialog)
1881
 
{
1882
 
  if (dialog->icon_path) {
1883
 
          char *icon_path;
1884
 
 
1885
 
          icon_path = g_strdup (dialog->icon_path);
1886
 
          panel_run_dialog_set_icon (dialog, icon_path, TRUE);
1887
 
          g_free (icon_path);
1888
 
  }
1889
 
}
1890
 
 
1891
 
static void
1892
1795
panel_run_dialog_setup_pixmap (PanelRunDialog *dialog,
1893
1796
                               GtkBuilder     *gui)
1894
1797
{
1895
1798
        dialog->pixmap = PANEL_GTK_BUILDER_GET (gui, "icon_pixmap");
1896
1799
        
1897
 
        g_signal_connect (dialog->pixmap, "style-updated",
1898
 
                          G_CALLBACK (panel_run_dialog_style_updated),
1899
 
                          dialog);
1900
 
        g_signal_connect (dialog->pixmap, "screen-changed",
1901
 
                          G_CALLBACK (panel_run_dialog_screen_changed),
1902
 
                          dialog);
1903
 
 
1904
1800
        g_signal_connect (dialog->run_dialog, "drag_data_get",
1905
1801
                          G_CALLBACK (pixmap_drag_data_get),
1906
1802
                          dialog);
1934
1830
        panel_run_dialog_setup_program_list  (dialog, gui);
1935
1831
        panel_run_dialog_setup_list_expander (dialog, gui);
1936
1832
 
1937
 
        panel_run_dialog_set_default_icon    (dialog, FALSE);
 
1833
        gtk_window_set_icon_name (GTK_WINDOW (dialog->run_dialog),
 
1834
                                  PANEL_ICON_RUN);
 
1835
        panel_run_dialog_set_default_icon (dialog, FALSE);
1938
1836
 
1939
1837
        g_signal_connect (dialog->run_settings, "changed::"PANEL_RUN_ENABLE_LIST_KEY,
1940
1838
                          G_CALLBACK (panel_run_dialog_update_program_list), dialog);
1960
1858
}
1961
1859
 
1962
1860
static void
1963
 
panel_run_dialog_disconnect_pixmap (PanelRunDialog *dialog)
1964
 
{
1965
 
        g_signal_handlers_disconnect_by_func (dialog->pixmap,
1966
 
                                              G_CALLBACK (panel_run_dialog_style_updated),
1967
 
                                              dialog);
1968
 
        g_signal_handlers_disconnect_by_func (dialog->pixmap,
1969
 
                                              G_CALLBACK (panel_run_dialog_screen_changed),
1970
 
                                              dialog);
1971
 
}
1972
 
 
1973
 
static void
1974
1861
panel_run_dialog_static_dialog_destroyed (PanelRunDialog *dialog)
1975
1862
{
1976
1863
        /* just reset the static dialog to NULL for next time */