X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkappchooserdialog.c;h=00882d558423eaa6be5a4ff175e1fd7dc910b40b;hb=0cc688aa92b8fe5452b63fb49c51204498a2988b;hp=2b8c815f9067def557be369bc2177af88e1ac16d;hpb=2ae2c443d0413d129893573a44afadcd182ce243;p=~andy%2Fgtk
diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c
index 2b8c815f9..00882d558 100644
--- a/gtk/gtkappchooserdialog.c
+++ b/gtk/gtkappchooserdialog.c
@@ -15,9 +15,7 @@
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
- * License along with the Gnome Library; see the file COPYING.LIB. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see .
*
* Authors: Dave Camp
* Alexander Larsson
@@ -187,7 +185,7 @@ app_chooser_online_get_default_ready_cb (GObject *source,
GtkWidget *action_area;
action_area = gtk_dialog_get_action_area (GTK_DIALOG (self));
- self->priv->online_button = gtk_button_new_with_label (_("Find applications online"));
+ self->priv->online_button = gtk_button_new_with_mnemonic (_("_Find applications online"));
gtk_box_pack_start (GTK_BOX (action_area), self->priv->online_button,
FALSE, FALSE, 0);
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (action_area), self->priv->online_button,
@@ -214,71 +212,6 @@ ensure_online_button (GtkAppChooserDialog *self)
g_object_ref (self));
}
-/* An application is valid if:
- *
- * 1) The file exists
- * 2) The user has permissions to run the file
- */
-static gboolean
-check_application (GtkAppChooserDialog *self,
- GAppInfo **app_out)
-{
- const char *command;
- char *path = NULL;
- char **argv = NULL;
- int argc;
- GError *error = NULL;
- gint retval = TRUE;
- GAppInfo *info;
-
- command = NULL;
-
- info = gtk_app_chooser_get_app_info (GTK_APP_CHOOSER (self->priv->app_chooser_widget));
- if (info == NULL)
- {
- *app_out = NULL;
- return FALSE;
- }
-
- command = g_app_info_get_executable (info);
-
- g_shell_parse_argv (command, &argc, &argv, &error);
-
- if (error)
- {
- show_error_dialog (_("Could not run application"),
- error->message,
- GTK_WINDOW (self));
- g_error_free (error);
- retval = FALSE;
- goto cleanup;
- }
-
- path = g_find_program_in_path (argv[0]);
- if (!path)
- {
- char *error_message;
-
- error_message = g_strdup_printf (_("Could not find '%s'"),
- argv[0]);
-
- show_error_dialog (_("Could not find application"),
- error_message,
- GTK_WINDOW (self));
- g_free (error_message);
- retval = FALSE;
- goto cleanup;
- }
-
- *app_out = info;
-
- cleanup:
- g_strfreev (argv);
- g_free (path);
-
- return retval;
-}
-
static void
add_or_find_application (GtkAppChooserDialog *self)
{
@@ -608,12 +541,7 @@ static GAppInfo *
gtk_app_chooser_dialog_get_app_info (GtkAppChooser *object)
{
GtkAppChooserDialog *self = GTK_APP_CHOOSER_DIALOG (object);
- GAppInfo *app = NULL;
-
- if (!check_application (self, &app))
- return NULL;
-
- return app;
+ return gtk_app_chooser_get_app_info (GTK_APP_CHOOSER (self->priv->app_chooser_widget));
}
static void