info: Split default-apps into its own panel
This commit is contained in:
parent
b307e0a7d9
commit
e743b8efd7
11 changed files with 82 additions and 37 deletions
|
@ -21,8 +21,8 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include "cc-info-default-apps-panel.h"
|
||||
#include "cc-info-resources.h"
|
||||
#include "cc-default-apps-panel.h"
|
||||
#include "cc-default-apps-resources.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ typedef struct
|
|||
const char *extra_type_filter;
|
||||
} DefaultAppData;
|
||||
|
||||
struct _CcInfoDefaultAppsPanel
|
||||
struct _CcDefaultAppsPanel
|
||||
{
|
||||
CcPanel parent_instance;
|
||||
|
||||
|
@ -49,11 +49,11 @@ struct _CcInfoDefaultAppsPanel
|
|||
};
|
||||
|
||||
|
||||
G_DEFINE_TYPE (CcInfoDefaultAppsPanel, cc_info_default_apps_panel, CC_TYPE_PANEL)
|
||||
G_DEFINE_TYPE (CcDefaultAppsPanel, cc_default_apps_panel, CC_TYPE_PANEL)
|
||||
|
||||
static void
|
||||
default_app_changed (GtkAppChooserButton *button,
|
||||
CcInfoDefaultAppsPanel *self)
|
||||
default_app_changed (GtkAppChooserButton *button,
|
||||
CcDefaultAppsPanel *self)
|
||||
{
|
||||
g_autoptr(GAppInfo) info = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
@ -119,14 +119,14 @@ default_app_changed (GtkAppChooserButton *button,
|
|||
}
|
||||
}
|
||||
|
||||
#define OFFSET(x) (G_STRUCT_OFFSET (CcInfoDefaultAppsPanel, x))
|
||||
#define OFFSET(x) (G_STRUCT_OFFSET (CcDefaultAppsPanel, x))
|
||||
#define WIDGET_FROM_OFFSET(x) (G_STRUCT_MEMBER (GtkWidget*, self, x))
|
||||
|
||||
static void
|
||||
info_panel_setup_default_app (CcInfoDefaultAppsPanel *self,
|
||||
DefaultAppData *data,
|
||||
guint left_attach,
|
||||
guint top_attach)
|
||||
info_panel_setup_default_app (CcDefaultAppsPanel *self,
|
||||
DefaultAppData *data,
|
||||
guint left_attach,
|
||||
guint top_attach)
|
||||
{
|
||||
GtkWidget *button;
|
||||
GtkWidget *label;
|
||||
|
@ -162,7 +162,7 @@ static DefaultAppData preferred_app_infos[] = {
|
|||
};
|
||||
|
||||
static void
|
||||
info_panel_setup_default_apps (CcInfoDefaultAppsPanel *self)
|
||||
info_panel_setup_default_apps (CcDefaultAppsPanel *self)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -174,24 +174,24 @@ info_panel_setup_default_apps (CcInfoDefaultAppsPanel *self)
|
|||
}
|
||||
|
||||
static void
|
||||
cc_info_default_apps_panel_class_init (CcInfoDefaultAppsPanelClass *klass)
|
||||
cc_default_apps_panel_class_init (CcDefaultAppsPanelClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/info/cc-info-default-apps-panel.ui");
|
||||
gtk_widget_class_bind_template_child (widget_class, CcInfoDefaultAppsPanel, default_apps_grid);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcInfoDefaultAppsPanel, web_label);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcInfoDefaultAppsPanel, mail_label);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcInfoDefaultAppsPanel, calendar_label);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcInfoDefaultAppsPanel, music_label);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcInfoDefaultAppsPanel, video_label);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcInfoDefaultAppsPanel, photos_label);
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/default-apps/cc-default-apps-panel.ui");
|
||||
gtk_widget_class_bind_template_child (widget_class, CcDefaultAppsPanel, default_apps_grid);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcDefaultAppsPanel, web_label);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcDefaultAppsPanel, mail_label);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcDefaultAppsPanel, calendar_label);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcDefaultAppsPanel, music_label);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcDefaultAppsPanel, video_label);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcDefaultAppsPanel, photos_label);
|
||||
}
|
||||
|
||||
static void
|
||||
cc_info_default_apps_panel_init (CcInfoDefaultAppsPanel *self)
|
||||
cc_default_apps_panel_init (CcDefaultAppsPanel *self)
|
||||
{
|
||||
g_resources_register (cc_info_get_resource ());
|
||||
g_resources_register (cc_default_apps_get_resource ());
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
|
||||
|
@ -199,8 +199,8 @@ cc_info_default_apps_panel_init (CcInfoDefaultAppsPanel *self)
|
|||
}
|
||||
|
||||
GtkWidget *
|
||||
cc_info_default_apps_panel_new (void)
|
||||
cc_default_apps_panel_new (void)
|
||||
{
|
||||
return g_object_new (CC_TYPE_INFO_DEFAULT_APPS_PANEL,
|
||||
return g_object_new (CC_TYPE_DEFAULT_APPS_PANEL,
|
||||
NULL);
|
||||
}
|
|
@ -23,9 +23,9 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CC_TYPE_INFO_DEFAULT_APPS_PANEL (cc_info_default_apps_panel_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (CcInfoDefaultAppsPanel, cc_info_default_apps_panel, CC, INFO_DEFAULT_APPS_PANEL, CcPanel)
|
||||
#define CC_TYPE_DEFAULT_APPS_PANEL (cc_default_apps_panel_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (CcDefaultAppsPanel, cc_default_apps_panel, CC, DEFAULT_APPS_PANEL, CcPanel)
|
||||
|
||||
GtkWidget *cc_info_default_apps_panel_new (void);
|
||||
GtkWidget *cc_default_apps_panel_new (void);
|
||||
|
||||
G_END_DECLS
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.0 -->
|
||||
<template class="CcInfoDefaultAppsPanel" parent="CcPanel">
|
||||
<template class="CcDefaultAppsPanel" parent="CcPanel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="expand">True</property>
|
6
panels/default-apps/default-apps.gresource.xml
Normal file
6
panels/default-apps/default-apps.gresource.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/org/gnome/control-center/default-apps">
|
||||
<file preprocess="xml-stripblanks">cc-default-apps-panel.ui</file>
|
||||
</gresource>
|
||||
</gresources>
|
42
panels/default-apps/meson.build
Normal file
42
panels/default-apps/meson.build
Normal file
|
@ -0,0 +1,42 @@
|
|||
panels_list += cappletname
|
||||
desktop = 'gnome-@0@-panel.desktop'.format(cappletname)
|
||||
|
||||
desktop_in = configure_file(
|
||||
input: desktop + '.in.in',
|
||||
output: desktop + '.in',
|
||||
configuration: desktop_conf
|
||||
)
|
||||
|
||||
i18n.merge_file(
|
||||
desktop,
|
||||
type: 'desktop',
|
||||
input: desktop_in,
|
||||
output: desktop,
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: control_center_desktopdir
|
||||
)
|
||||
|
||||
sources = files(
|
||||
'cc-default-apps-panel.c'
|
||||
)
|
||||
|
||||
resource_data = files(
|
||||
'cc-default-apps-panel.ui'
|
||||
)
|
||||
|
||||
sources += gnome.compile_resources(
|
||||
'cc-' + cappletname + '-resources',
|
||||
cappletname + '.gresource.xml',
|
||||
c_name: 'cc_' + cappletname.underscorify (),
|
||||
dependencies: resource_data,
|
||||
export: true
|
||||
)
|
||||
|
||||
panels_libs += static_library(
|
||||
cappletname,
|
||||
sources: sources,
|
||||
include_directories: [ top_inc, common_inc ],
|
||||
dependencies: common_deps,
|
||||
c_args: cflags
|
||||
)
|
|
@ -2,7 +2,6 @@
|
|||
<gresources>
|
||||
<gresource prefix="/org/gnome/control-center/info">
|
||||
<file preprocess="xml-stripblanks">cc-info-overview-panel.ui</file>
|
||||
<file preprocess="xml-stripblanks">cc-info-default-apps-panel.ui</file>
|
||||
<file preprocess="xml-stripblanks">cc-info-removable-media-panel.ui</file>
|
||||
<file>GnomeLogoVerticalMedium.svg</file>
|
||||
</gresource>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
panel_names = [
|
||||
'default-apps',
|
||||
'info-overview',
|
||||
'removable-media'
|
||||
]
|
||||
|
@ -33,7 +32,6 @@ cflags += [
|
|||
]
|
||||
|
||||
sources = files(
|
||||
'cc-info-default-apps-panel.c',
|
||||
'cc-info-overview-panel.c',
|
||||
'cc-info-removable-media-panel.c',
|
||||
'info-cleanup.c'
|
||||
|
@ -41,7 +39,6 @@ sources = files(
|
|||
|
||||
resource_data = files(
|
||||
'GnomeLogoVerticalMedium.svg',
|
||||
'cc-info-default-apps-panel.ui',
|
||||
'cc-info-overview-panel.ui',
|
||||
'cc-info-removable-media-panel.ui'
|
||||
)
|
||||
|
|
|
@ -5,6 +5,7 @@ panels = [
|
|||
'background',
|
||||
'color',
|
||||
'datetime',
|
||||
'default-apps',
|
||||
'display',
|
||||
'info',
|
||||
'keyboard',
|
||||
|
|
|
@ -35,6 +35,8 @@ panels/datetime/little.ui
|
|||
panels/datetime/middle.ui
|
||||
panels/datetime/org.gnome.controlcenter.datetime.policy.in
|
||||
panels/datetime/ydm.ui
|
||||
panels/default-apps/cc-default-apps-panel.ui
|
||||
panels/default-apps/gnome-default-apps-panel.desktop.in.in
|
||||
panels/display/cc-display-panel.c
|
||||
panels/display/cc-display-panel.ui
|
||||
panels/display/cc-display-settings.c
|
||||
|
@ -42,12 +44,10 @@ panels/display/cc-display-settings.ui
|
|||
panels/display/cc-night-light-page.c
|
||||
panels/display/cc-night-light-page.ui
|
||||
panels/display/gnome-display-panel.desktop.in.in
|
||||
panels/info/cc-info-default-apps-panel.ui
|
||||
panels/info/cc-info-overview-panel.c
|
||||
panels/info/cc-info-overview-panel.ui
|
||||
panels/info/cc-info-removable-media-panel.c
|
||||
panels/info/cc-info-removable-media-panel.ui
|
||||
panels/info/gnome-default-apps-panel.desktop.in.in
|
||||
panels/info/gnome-info-overview-panel.desktop.in.in
|
||||
panels/info/gnome-removable-media-panel.desktop.in.in
|
||||
panels/keyboard/00-multimedia.xml.in
|
||||
|
|
|
@ -38,9 +38,9 @@ extern GType cc_bluetooth_panel_get_type (void);
|
|||
#endif /* BUILD_BLUETOOTH */
|
||||
extern GType cc_color_panel_get_type (void);
|
||||
extern GType cc_date_time_panel_get_type (void);
|
||||
extern GType cc_default_apps_panel_get_type (void);
|
||||
extern GType cc_display_panel_get_type (void);
|
||||
extern GType cc_info_overview_panel_get_type (void);
|
||||
extern GType cc_info_default_apps_panel_get_type (void);
|
||||
extern GType cc_info_removable_media_panel_get_type (void);
|
||||
extern GType cc_keyboard_panel_get_type (void);
|
||||
extern GType cc_mouse_panel_get_type (void);
|
||||
|
@ -91,9 +91,9 @@ static CcPanelLoaderVtable default_panels[] =
|
|||
#endif
|
||||
PANEL_TYPE("color", cc_color_panel_get_type, NULL),
|
||||
PANEL_TYPE("datetime", cc_date_time_panel_get_type, NULL),
|
||||
PANEL_TYPE("default-apps", cc_default_apps_panel_get_type, NULL),
|
||||
PANEL_TYPE("display", cc_display_panel_get_type, NULL),
|
||||
PANEL_TYPE("info-overview", cc_info_overview_panel_get_type, NULL),
|
||||
PANEL_TYPE("default-apps", cc_info_default_apps_panel_get_type, NULL),
|
||||
PANEL_TYPE("removable-media", cc_info_removable_media_panel_get_type, NULL),
|
||||
PANEL_TYPE("keyboard", cc_keyboard_panel_get_type, NULL),
|
||||
PANEL_TYPE("mouse", cc_mouse_panel_get_type, NULL),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue