Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dorota Czaplejewicz
gtk
Commits
05bb715c
Commit
05bb715c
authored
Nov 23, 2010
by
Cosimo Cecchi
Browse files
app-chooser: rename GtkOpenWith to GtkAppChooser
parent
6f0a6058
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
gtk/Makefile.am
View file @
05bb715c
...
...
@@ -246,10 +246,10 @@ gtk_public_h_sources = \
gtkmountoperation.h
\
gtknotebook.h
\
gtkoffscreenwindow.h
\
gtk
openwith
.h
\
gtk
openwith
dialog.h
\
gtk
openwith
widget.h
\
gtk
openwith
online.h
\
gtk
appchooser
.h
\
gtk
appchooser
dialog.h
\
gtk
appchooser
widget.h
\
gtk
appchooser
online.h
\
gtkorientable.h
\
gtkpagesetup.h
\
gtkpaned.h
\
...
...
@@ -354,14 +354,14 @@ gtk_semi_private_h_sources = \
gtktextlayout.h
if
ENABLE_PACKAGEKIT
gtk_
openwith
_impl_h_sources
=
\
gtk
openwith
onlinepk.h
\
gtk_
appchooser
_impl_h_sources
=
\
gtk
appchooser
onlinepk.h
\
$(NULL)
endif
if
ENABLE_PACKAGEKIT
gtk_
openwith
_impl_c_sources
=
\
gtk
openwith
onlinepk.c
\
gtk_
appchooser
_impl_c_sources
=
\
gtk
appchooser
onlinepk.c
\
$(NULL)
endif
...
...
@@ -389,9 +389,9 @@ gtk_private_h_sources = \
gtkmenuprivate.h
\
gtkmnemonichash.h
\
gtkmountoperationprivate.h
\
gtk
openwith
private.h
\
gtk
openwith
module.h
\
gtk
openwith
onlinedummy.h
\
gtk
appchooser
private.h
\
gtk
appchooser
module.h
\
gtk
appchooser
onlinedummy.h
\
gtkpango.h
\
gtkpathbar.h
\
gtkplugprivate.h
\
...
...
@@ -420,7 +420,7 @@ gtk_private_h_sources = \
gtkwindow-decorate.h
\
gtkwidgetprivate.h
\
$(gtk_clipboard_dnd_h_sources)
\
$(gtk_
openwith
_impl_h_sources)
$(gtk_
appchooser
_impl_h_sources)
# GTK+ C sources to build the library from
gtk_base_c_sources
=
\
...
...
@@ -536,12 +536,12 @@ gtk_base_c_sources = \
gtkmountoperation.c
\
gtknotebook.c
\
gtkoffscreenwindow.c
\
gtk
openwith
.c
\
gtk
openwith
widget.c
\
gtk
openwith
dialog.c
\
gtk
openwith
module.c
\
gtk
openwith
online.c
\
gtk
openwith
onlinedummy.c
\
gtk
appchooser
.c
\
gtk
appchooser
widget.c
\
gtk
appchooser
dialog.c
\
gtk
appchooser
module.c
\
gtk
appchooser
online.c
\
gtk
appchooser
onlinedummy.c
\
gtkorientable.c
\
gtkpagesetup.c
\
gtkpaned.c
\
...
...
@@ -647,7 +647,7 @@ gtk_base_c_sources = \
gtkwindow-decorate.c
\
gtkwindow.c
\
$(gtk_clipboard_dnd_c_sources)
\
$(gtk_
openwith
_impl_c_sources)
$(gtk_
appchooser
_impl_c_sources)
gtk_c_sources
=
$(gtk_base_c_sources)
gtk_all_c_sources
=
$(gtk_base_c_sources)
...
...
gtk/gtk.h
View file @
05bb715c
...
...
@@ -129,9 +129,9 @@
#include <gtk/gtkmountoperation.h>
#include <gtk/gtknotebook.h>
#include <gtk/gtkoffscreenwindow.h>
#include <gtk/gtk
openwith
.h>
#include <gtk/gtk
openwith
dialog.h>
#include <gtk/gtk
openwith
widget.h>
#include <gtk/gtk
appchooser
.h>
#include <gtk/gtk
appchooser
dialog.h>
#include <gtk/gtk
appchooser
widget.h>
#include <gtk/gtkorientable.h>
#include <gtk/gtkpagesetup.h>
#include <gtk/gtkpapersize.h>
...
...
gtk/gtk
openwith
.c
→
gtk/gtk
appchooser
.c
View file @
05bb715c
/*
* gtk
openwith.c: open-with
interface
* gtk
appchooser.c: app-chooser
interface
*
* Copyright (C) 2010 Red Hat, Inc.
*
...
...
@@ -23,18 +23,18 @@
#include <config.h>
#include "gtk
openwith
.h"
#include "gtk
appchooser
.h"
#include "gtkintl.h"
#include "gtk
openwith
private.h"
#include "gtk
appchooser
private.h"
#include "gtkwidget.h"
#include <glib.h>
G_DEFINE_INTERFACE
(
Gtk
OpenWith
,
gtk_open_with
,
GTK_TYPE_WIDGET
);
G_DEFINE_INTERFACE
(
Gtk
AppChooser
,
gtk_app_chooser
,
GTK_TYPE_WIDGET
);
static
void
gtk_
open_with
_default_init
(
Gtk
OpenWith
Iface
*
iface
)
gtk_
app_chooser
_default_init
(
Gtk
AppChooser
Iface
*
iface
)
{
GParamSpec
*
pspec
;
...
...
@@ -48,11 +48,11 @@ gtk_open_with_default_init (GtkOpenWithIface *iface)
}
gchar
*
gtk_
open_with
_get_content_type
(
Gtk
OpenWith
*
self
)
gtk_
app_chooser
_get_content_type
(
Gtk
AppChooser
*
self
)
{
gchar
*
retval
=
NULL
;
g_return_val_if_fail
(
GTK_IS_
OPEN_WITH
(
self
),
NULL
);
g_return_val_if_fail
(
GTK_IS_
APP_CHOOSER
(
self
),
NULL
);
g_object_get
(
self
,
"content-type"
,
&
retval
,
...
...
@@ -62,13 +62,13 @@ gtk_open_with_get_content_type (GtkOpenWith *self)
}
GAppInfo
*
gtk_
open_with
_get_app_info
(
Gtk
OpenWith
*
self
)
gtk_
app_chooser
_get_app_info
(
Gtk
AppChooser
*
self
)
{
return
GTK_
OPEN_WITH
_GET_IFACE
(
self
)
->
get_app_info
(
self
);
return
GTK_
APP_CHOOSER
_GET_IFACE
(
self
)
->
get_app_info
(
self
);
}
void
gtk_
open_with
_refresh
(
Gtk
OpenWith
*
self
)
gtk_
app_chooser
_refresh
(
Gtk
AppChooser
*
self
)
{
GTK_
OPEN_WITH
_GET_IFACE
(
self
)
->
refresh
(
self
);
GTK_
APP_CHOOSER
_GET_IFACE
(
self
)
->
refresh
(
self
);
}
gtk/gtk
openwith
.h
→
gtk/gtk
appchooser
.h
View file @
05bb715c
/*
* gtk
openwith.h: open-with
interface
* gtk
appchooser.h: app-chooser
interface
*
* Copyright (C) 2010 Red Hat, Inc.
*
...
...
@@ -25,30 +25,30 @@
#error "Only <gtk/gtk.h> can be included directly."
#endif
#ifndef __GTK_
OPEN_WITH
_H__
#define __GTK_
OPEN_WITH
_H__
#ifndef __GTK_
APP_CHOOSER
_H__
#define __GTK_
APP_CHOOSER
_H__
#include <glib.h>
#include <gio/gio.h>
G_BEGIN_DECLS
#define GTK_TYPE_
OPEN_WITH
\
(gtk_
open_with
_get_type ())
#define GTK_
OPEN_WITH
(obj)\
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_
OPEN_WITH, GtkOpenWith
))
#define GTK_IS_
OPEN_WITH
(obj)\
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_
OPEN_WITH
))
#define GTK_TYPE_
APP_CHOOSER
\
(gtk_
app_chooser
_get_type ())
#define GTK_
APP_CHOOSER
(obj)\
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_
APP_CHOOSER, GtkAppChooser
))
#define GTK_IS_
APP_CHOOSER
(obj)\
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_
APP_CHOOSER
))
typedef
struct
_Gtk
OpenWith
GtkOpenWith
;
typedef
struct
_Gtk
AppChooser
GtkAppChooser
;
GType
gtk_
open_with
_get_type
()
G_GNUC_CONST
;
GType
gtk_
app_chooser
_get_type
()
G_GNUC_CONST
;
GAppInfo
*
gtk_
open_with
_get_app_info
(
Gtk
OpenWith
*
self
);
gchar
*
gtk_
open_with
_get_content_type
(
Gtk
OpenWith
*
self
);
void
gtk_
open_with
_refresh
(
Gtk
OpenWith
*
self
);
GAppInfo
*
gtk_
app_chooser
_get_app_info
(
Gtk
AppChooser
*
self
);
gchar
*
gtk_
app_chooser
_get_content_type
(
Gtk
AppChooser
*
self
);
void
gtk_
app_chooser
_refresh
(
Gtk
AppChooser
*
self
);
G_END_DECLS
#endif
/* __GTK_
OPEN_WITH
_H__ */
#endif
/* __GTK_
APP_CHOOSER
_H__ */
gtk/gtk
openwith
dialog.c
→
gtk/gtk
appchooser
dialog.c
View file @
05bb715c
/*
* gtk
openwith
dialog.c: an
open-with
dialog
* gtk
appchooser
dialog.c: an
app-chooser
dialog
*
* Copyright (C) 2004 Novell, Inc.
* Copyright (C) 2007, 2010 Red Hat, Inc.
...
...
@@ -26,12 +26,12 @@
#include <config.h>
#include "gtk
openwith
dialog.h"
#include "gtk
appchooser
dialog.h"
#include "gtkintl.h"
#include "gtk
openwith
.h"
#include "gtk
openwith
online.h"
#include "gtk
openwith
private.h"
#include "gtk
appchooser
.h"
#include "gtk
appchooser
online.h"
#include "gtk
appchooser
private.h"
#include <string.h>
#include <glib/gi18n-lib.h>
...
...
@@ -40,7 +40,7 @@
#define sure_string(s) ((const char *) ((s) != NULL ? (s) : ""))
struct
_Gtk
OpenWith
DialogPrivate
{
struct
_Gtk
AppChooser
DialogPrivate
{
char
*
content_type
;
GFile
*
gfile
;
...
...
@@ -50,7 +50,7 @@ struct _GtkOpenWithDialogPrivate {
GtkWidget
*
open_label
;
GtkWidget
*
open_with
_widget
;
GtkWidget
*
app_chooser
_widget
;
GtkWidget
*
show_more_button
;
gboolean
show_more_clicked
;
...
...
@@ -62,10 +62,10 @@ enum {
N_PROPERTIES
};
static
void
gtk_
open_with
_dialog_iface_init
(
Gtk
OpenWith
Iface
*
iface
);
G_DEFINE_TYPE_WITH_CODE
(
Gtk
OpenWith
Dialog
,
gtk_
open_with
_dialog
,
GTK_TYPE_DIALOG
,
G_IMPLEMENT_INTERFACE
(
GTK_TYPE_
OPEN_WITH
,
gtk_
open_with
_dialog_iface_init
));
static
void
gtk_
app_chooser
_dialog_iface_init
(
Gtk
AppChooser
Iface
*
iface
);
G_DEFINE_TYPE_WITH_CODE
(
Gtk
AppChooser
Dialog
,
gtk_
app_chooser
_dialog
,
GTK_TYPE_DIALOG
,
G_IMPLEMENT_INTERFACE
(
GTK_TYPE_
APP_CHOOSER
,
gtk_
app_chooser
_dialog_iface_init
));
static
void
show_error_dialog
(
const
gchar
*
primary
,
...
...
@@ -95,11 +95,11 @@ search_for_mimetype_ready_cb (GObject *source,
GAsyncResult
*
res
,
gpointer
user_data
)
{
Gtk
OpenWith
Online
*
online
=
GTK_
OPEN_WITH
_ONLINE
(
source
);
Gtk
OpenWith
Dialog
*
self
=
user_data
;
Gtk
AppChooser
Online
*
online
=
GTK_
APP_CHOOSER
_ONLINE
(
source
);
Gtk
AppChooser
Dialog
*
self
=
user_data
;
GError
*
error
=
NULL
;
gtk_
open_with
_online_search_for_mimetype_finish
(
online
,
res
,
&
error
);
gtk_
app_chooser
_online_search_for_mimetype_finish
(
online
,
res
,
&
error
);
if
(
error
!=
NULL
)
{
...
...
@@ -109,7 +109,7 @@ search_for_mimetype_ready_cb (GObject *source,
}
else
{
gtk_
open_with
_refresh
(
GTK_
OPEN_WITH
(
self
->
priv
->
open_with
_widget
));
gtk_
app_chooser
_refresh
(
GTK_
APP_CHOOSER
(
self
->
priv
->
app_chooser
_widget
));
}
g_object_unref
(
online
);
...
...
@@ -119,16 +119,16 @@ static void
online_button_clicked_cb
(
GtkButton
*
b
,
gpointer
user_data
)
{
Gtk
OpenWith
Online
*
online
;
Gtk
OpenWith
Dialog
*
self
=
user_data
;
Gtk
AppChooser
Online
*
online
;
Gtk
AppChooser
Dialog
*
self
=
user_data
;
online
=
gtk_
open_with
_online_get_default
();
online
=
gtk_
app_chooser
_online_get_default
();
gtk_
open_with
_online_search_for_mimetype_async
(
online
,
self
->
priv
->
content_type
,
GTK_WINDOW
(
self
),
search_for_mimetype_ready_cb
,
self
);
gtk_
app_chooser
_online_search_for_mimetype_async
(
online
,
self
->
priv
->
content_type
,
GTK_WINDOW
(
self
),
search_for_mimetype_ready_cb
,
self
);
}
/* An application is valid if:
...
...
@@ -137,7 +137,7 @@ online_button_clicked_cb (GtkButton *b,
* 2) The user has permissions to run the file
*/
static
gboolean
check_application
(
Gtk
OpenWith
Dialog
*
self
,
check_application
(
Gtk
AppChooser
Dialog
*
self
,
GAppInfo
**
app_out
)
{
const
char
*
command
;
...
...
@@ -150,7 +150,7 @@ check_application (GtkOpenWithDialog *self,
command
=
NULL
;
info
=
gtk_
open_with
_get_app_info
(
GTK_
OPEN_WITH
(
self
->
priv
->
open_with
_widget
));
info
=
gtk_
app_chooser
_get_app_info
(
GTK_
APP_CHOOSER
(
self
->
priv
->
app_chooser
_widget
));
command
=
g_app_info_get_executable
(
info
);
g_shell_parse_argv
(
command
,
&
argc
,
&
argv
,
&
error
);
...
...
@@ -191,21 +191,21 @@ check_application (GtkOpenWithDialog *self,
}
static
void
widget_application_selected_cb
(
Gtk
OpenWith
Widget
*
widget
,
widget_application_selected_cb
(
Gtk
AppChooser
Widget
*
widget
,
GAppInfo
*
app_info
,
gpointer
user_data
)
{
Gtk
OpenWith
Dialog
*
self
=
user_data
;
Gtk
AppChooser
Dialog
*
self
=
user_data
;
gtk_widget_set_sensitive
(
self
->
priv
->
button
,
TRUE
);
}
static
void
widget_application_activated_cb
(
Gtk
OpenWith
Widget
*
widget
,
widget_application_activated_cb
(
Gtk
AppChooser
Widget
*
widget
,
GAppInfo
*
app_info
,
gpointer
user_data
)
{
Gtk
OpenWith
Dialog
*
self
=
user_data
;
Gtk
AppChooser
Dialog
*
self
=
user_data
;
gtk_dialog_response
(
GTK_DIALOG
(
self
),
GTK_RESPONSE_OK
);
}
...
...
@@ -224,7 +224,7 @@ get_extension (const char *basename)
}
static
void
set_dialog_properties
(
Gtk
OpenWith
Dialog
*
self
)
set_dialog_properties
(
Gtk
AppChooser
Dialog
*
self
)
{
char
*
label
,
*
name
,
*
extension
,
*
description
,
*
default_text
,
*
string
;
PangoFontDescription
*
font_desc
;
...
...
@@ -273,8 +273,8 @@ set_dialog_properties (GtkOpenWithDialog *self)
_
(
"Click
\"
Show other applications
\"
, for more options, or "
"
\"
Find applications online
\"
to install a new application"
));
gtk_
open_with
_widget_set_default_text
(
GTK_
OPEN_WITH
_WIDGET
(
self
->
priv
->
open_with
_widget
),
default_text
);
gtk_
app_chooser
_widget_set_default_text
(
GTK_
APP_CHOOSER
_WIDGET
(
self
->
priv
->
app_chooser
_widget
),
default_text
);
g_free
(
label
);
g_free
(
name
);
...
...
@@ -288,9 +288,9 @@ static void
show_more_button_clicked_cb
(
GtkButton
*
button
,
gpointer
user_data
)
{
Gtk
OpenWith
Dialog
*
self
=
user_data
;
Gtk
AppChooser
Dialog
*
self
=
user_data
;
g_object_set
(
self
->
priv
->
open_with
_widget
,
g_object_set
(
self
->
priv
->
app_chooser
_widget
,
"show-recommended"
,
TRUE
,
"show-fallback"
,
TRUE
,
"show-other"
,
TRUE
,
...
...
@@ -305,11 +305,11 @@ widget_notify_for_button_cb (GObject *source,
GParamSpec
*
pspec
,
gpointer
user_data
)
{
Gtk
OpenWith
Dialog
*
self
=
user_data
;
Gtk
OpenWith
Widget
*
widget
=
GTK_
OPEN_WITH
_WIDGET
(
source
);
Gtk
AppChooser
Dialog
*
self
=
user_data
;
Gtk
AppChooser
Widget
*
widget
=
GTK_
APP_CHOOSER
_WIDGET
(
source
);
gboolean
should_hide
;
should_hide
=
gtk_
open_with
_widget_get_show_all
(
widget
)
||
should_hide
=
gtk_
app_chooser
_widget_get_show_all
(
widget
)
||
self
->
priv
->
show_more_clicked
;
if
(
should_hide
)
...
...
@@ -317,7 +317,7 @@ widget_notify_for_button_cb (GObject *source,
}
static
void
build_dialog_ui
(
Gtk
OpenWith
Dialog
*
self
)
build_dialog_ui
(
Gtk
AppChooser
Dialog
*
self
)
{
GtkWidget
*
vbox
;
GtkWidget
*
vbox2
;
...
...
@@ -342,16 +342,16 @@ build_dialog_ui (GtkOpenWithDialog *self)
FALSE
,
FALSE
,
0
);
gtk_widget_show
(
self
->
priv
->
label
);
self
->
priv
->
open_with
_widget
=
gtk_
open_with
_widget_new
(
self
->
priv
->
content_type
);
gtk_box_pack_start
(
GTK_BOX
(
vbox2
),
self
->
priv
->
open_with
_widget
,
TRUE
,
TRUE
,
0
);
gtk_widget_show
(
self
->
priv
->
open_with
_widget
);
self
->
priv
->
app_chooser
_widget
=
gtk_
app_chooser
_widget_new
(
self
->
priv
->
content_type
);
gtk_box_pack_start
(
GTK_BOX
(
vbox2
),
self
->
priv
->
app_chooser
_widget
,
TRUE
,
TRUE
,
0
);
gtk_widget_show
(
self
->
priv
->
app_chooser
_widget
);
g_signal_connect
(
self
->
priv
->
open_with
_widget
,
"application-selected"
,
g_signal_connect
(
self
->
priv
->
app_chooser
_widget
,
"application-selected"
,
G_CALLBACK
(
widget_application_selected_cb
),
self
);
g_signal_connect
(
self
->
priv
->
open_with
_widget
,
"application-activated"
,
g_signal_connect
(
self
->
priv
->
app_chooser
_widget
,
"application-activated"
,
G_CALLBACK
(
widget_application_activated_cb
),
self
);
g_signal_connect
(
self
->
priv
->
open_with
_widget
,
"notify::show-all"
,
g_signal_connect
(
self
->
priv
->
app_chooser
_widget
,
"notify::show-all"
,
G_CALLBACK
(
widget_notify_for_button_cb
),
self
);
button
=
gtk_button_new_with_label
(
_
(
"Show other applications"
));
...
...
@@ -359,7 +359,7 @@ build_dialog_ui (GtkOpenWithDialog *self)
w
=
gtk_image_new_from_stock
(
GTK_STOCK_ADD
,
GTK_ICON_SIZE_BUTTON
);
gtk_button_set_image
(
GTK_BUTTON
(
button
),
w
);
gtk_box_pack_start
(
GTK_BOX
(
self
->
priv
->
open_with
_widget
),
button
,
FALSE
,
FALSE
,
6
);
gtk_box_pack_start
(
GTK_BOX
(
self
->
priv
->
app_chooser
_widget
),
button
,
FALSE
,
FALSE
,
6
);
gtk_widget_show_all
(
button
);
g_signal_connect
(
button
,
"clicked"
,
...
...
@@ -402,7 +402,7 @@ build_dialog_ui (GtkOpenWithDialog *self)
}
static
void
set_gfile_and_content_type
(
Gtk
OpenWith
Dialog
*
self
,
set_gfile_and_content_type
(
Gtk
AppChooser
Dialog
*
self
,
GFile
*
file
)
{
GFileInfo
*
info
;
...
...
@@ -421,9 +421,9 @@ set_gfile_and_content_type (GtkOpenWithDialog *self,
}
static
GAppInfo
*
gtk_
open_with
_dialog_get_app_info
(
Gtk
OpenWith
*
object
)
gtk_
app_chooser
_dialog_get_app_info
(
Gtk
AppChooser
*
object
)
{
Gtk
OpenWith
Dialog
*
self
=
GTK_
OPEN_WITH
_DIALOG
(
object
);
Gtk
AppChooser
Dialog
*
self
=
GTK_
APP_CHOOSER
_DIALOG
(
object
);
GAppInfo
*
app
=
NULL
;
if
(
!
check_application
(
self
,
&
app
))
...
...
@@ -433,48 +433,48 @@ gtk_open_with_dialog_get_app_info (GtkOpenWith *object)
}
static
void
gtk_
open_with
_dialog_refresh
(
Gtk
OpenWith
*
object
)
gtk_
app_chooser
_dialog_refresh
(
Gtk
AppChooser
*
object
)
{
Gtk
OpenWith
Dialog
*
self
=
GTK_
OPEN_WITH
_DIALOG
(
object
);
Gtk
AppChooser
Dialog
*
self
=
GTK_
APP_CHOOSER
_DIALOG
(
object
);
gtk_
open_with
_refresh
(
GTK_
OPEN_WITH
(
self
->
priv
->
open_with
_widget
));
gtk_
app_chooser
_refresh
(
GTK_
APP_CHOOSER
(
self
->
priv
->
app_chooser
_widget
));
}
static
void
gtk_
open_with
_dialog_constructed
(
GObject
*
object
)
gtk_
app_chooser
_dialog_constructed
(
GObject
*
object
)
{
Gtk
OpenWith
Dialog
*
self
=
GTK_
OPEN_WITH
_DIALOG
(
object
);
Gtk
AppChooser
Dialog
*
self
=
GTK_
APP_CHOOSER
_DIALOG
(
object
);
g_assert
(
self
->
priv
->
content_type
!=
NULL
||
self
->
priv
->
gfile
!=
NULL
);
if
(
G_OBJECT_CLASS
(
gtk_
open_with
_dialog_parent_class
)
->
constructed
!=
NULL
)
G_OBJECT_CLASS
(
gtk_
open_with
_dialog_parent_class
)
->
constructed
(
object
);
if
(
G_OBJECT_CLASS
(
gtk_
app_chooser
_dialog_parent_class
)
->
constructed
!=
NULL
)
G_OBJECT_CLASS
(
gtk_
app_chooser
_dialog_parent_class
)
->
constructed
(
object
);
build_dialog_ui
(
self
);
set_dialog_properties
(
self
);
}
static
void
gtk_
open_with
_dialog_finalize
(
GObject
*
object
)
gtk_
app_chooser
_dialog_finalize
(
GObject
*
object
)
{
Gtk
OpenWith
Dialog
*
self
=
GTK_
OPEN_WITH
_DIALOG
(
object
);
Gtk
AppChooser
Dialog
*
self
=
GTK_
APP_CHOOSER
_DIALOG
(
object
);
if
(
self
->
priv
->
gfile
)
g_object_unref
(
self
->
priv
->
gfile
);
g_free
(
self
->
priv
->
content_type
);
G_OBJECT_CLASS
(
gtk_
open_with
_dialog_parent_class
)
->
finalize
(
object
);
G_OBJECT_CLASS
(
gtk_
app_chooser
_dialog_parent_class
)
->
finalize
(
object
);
}
static
void
gtk_
open_with
_dialog_set_property
(
GObject
*
object
,
guint
property_id
,
const
GValue
*
value
,
GParamSpec
*
pspec
)
gtk_
app_chooser
_dialog_set_property
(
GObject
*
object
,
guint
property_id
,
const
GValue
*
value
,
GParamSpec
*
pspec
)
{
Gtk
OpenWith
Dialog
*
self
=
GTK_
OPEN_WITH
_DIALOG
(
object
);
Gtk
AppChooser
Dialog
*
self
=
GTK_
APP_CHOOSER
_DIALOG
(
object
);
switch
(
property_id
)
{
...
...
@@ -493,12 +493,12 @@ gtk_open_with_dialog_set_property (GObject *object,
}
static
void
gtk_
open_with
_dialog_get_property
(
GObject
*
object
,
guint
property_id
,
GValue
*
value
,
GParamSpec
*
pspec
)
gtk_
app_chooser
_dialog_get_property
(
GObject
*
object
,
guint
property_id
,
GValue
*
value
,
GParamSpec
*
pspec
)
{
Gtk
OpenWith
Dialog
*
self
=
GTK_
OPEN_WITH
_DIALOG
(
object
);
Gtk
AppChooser
Dialog
*
self
=
GTK_
APP_CHOOSER
_DIALOG
(
object
);
switch
(
property_id
)
{
...
...
@@ -516,23 +516,23 @@ gtk_open_with_dialog_get_property (GObject *object,
}
static
void
gtk_
open_with
_dialog_iface_init
(
Gtk
OpenWith
Iface
*
iface
)
gtk_
app_chooser
_dialog_iface_init
(
Gtk
AppChooser
Iface
*
iface
)
{
iface
->
get_app_info
=
gtk_
open_with
_dialog_get_app_info
;
iface
->
refresh
=
gtk_
open_with
_dialog_refresh
;
iface
->
get_app_info
=
gtk_
app_chooser
_dialog_get_app_info
;
iface
->
refresh
=
gtk_
app_chooser
_dialog_refresh
;
}
static
void
gtk_
open_with
_dialog_class_init
(
Gtk
OpenWith
DialogClass
*
klass
)
gtk_
app_chooser
_dialog_class_init
(
Gtk
AppChooser
DialogClass
*
klass
)
{
GObjectClass
*
gobject_class
;
GParamSpec
*
pspec
;
gobject_class
=
G_OBJECT_CLASS
(
klass
);
gobject_class
->
finalize
=
gtk_
open_with
_dialog_finalize
;
gobject_class
->
set_property
=
gtk_
open_with
_dialog_set_property
;
gobject_class
->
get_property
=
gtk_
open_with
_dialog_get_property
;
gobject_class
->
constructed
=
gtk_
open_with
_dialog_constructed
;
gobject_class
->
finalize
=
gtk_
app_chooser
_dialog_finalize
;
gobject_class
->
set_property
=
gtk_
app_chooser
_dialog_set_property
;
gobject_class
->
get_property
=
gtk_
app_chooser
_dialog_get_property
;
gobject_class
->
constructed
=
gtk_
app_chooser
_dialog_constructed
;
g_object_class_override_property
(
gobject_class
,
PROP_CONTENT_TYPE
,
"content-type"
);
...
...
@@ -544,14 +544,14 @@ gtk_open_with_dialog_class_init (GtkOpenWithDialogClass *klass)
G_PARAM_STATIC_STRINGS
);
g_object_class_install_property
(
gobject_class
,
PROP_GFILE
,
pspec
);
g_type_class_add_private
(
klass
,
sizeof
(
Gtk
OpenWith
DialogPrivate
));
g_type_class_add_private
(
klass
,
sizeof
(
Gtk
AppChooser
DialogPrivate
));
}
static
void
gtk_
open_with
_dialog_init
(
Gtk
OpenWith
Dialog
*
self
)
gtk_
app_chooser
_dialog_init
(
Gtk
AppChooser
Dialog
*
self
)
{
self
->
priv
=
G_TYPE_INSTANCE_GET_PRIVATE
(
self
,
GTK_TYPE_
OPEN_WITH
_DIALOG
,
Gtk
OpenWith
DialogPrivate
);
self
->
priv
=
G_TYPE_INSTANCE_GET_PRIVATE
(
self
,
GTK_TYPE_
APP_CHOOSER
_DIALOG
,
Gtk
AppChooser
DialogPrivate
);
}
static
void
...
...
@@ -571,28 +571,28 @@ set_parent_and_flags (GtkWidget *dialog,
}
/**
* gtk_
open_with
_dialog_new:
* gtk_
app_chooser
_dialog_new:
* @parent: (allow-none): a #GtkWindow, or %NULL
* @flags: flags for this dialog
* @file: a #GFile
*
* Creates a new #Gtk
OpenWith
Dialog for the provided #GFile, to allow
* Creates a new #Gtk
AppChooser
Dialog for the provided #GFile, to allow
* the user to select an application for it.
*
* Returns: a newly created #Gtk
OpenWith
Dialog
* Returns: a newly created #Gtk
AppChooser
Dialog
*
* Since: 3.0
**/
GtkWidget
*
gtk_
open_with
_dialog_new
(
GtkWindow
*
parent
,
GtkDialogFlags
flags
,
GFile
*
file
)
gtk_
app_chooser
_dialog_new
(
GtkWindow
*
parent
,
GtkDialogFlags
flags
,
GFile
*
file
)
{
GtkWidget
*
retval
;
g_return_val_if_fail
(
G_IS_FILE
(
file
),
NULL
);
retval
=
g_object_new
(
GTK_TYPE_
OPEN_WITH
_DIALOG
,
retval
=
g_object_new
(
GTK_TYPE_
APP_CHOOSER
_DIALOG
,
"gfile"
,
file
,
NULL
);
...
...
@@ -602,28 +602,28 @@ gtk_open_with_dialog_new (GtkWindow *parent,
}
/**
* gtk_
open_with
_dialog_new_for_content_type:
* gtk_
app_chooser
_dialog_new_for_content_type: