removable-media: UI changes
Make removable media UI conform with other panels. Based off of initial mockups given in #1096
This commit is contained in:
parent
20eda27bb9
commit
ccf7c8a565
2 changed files with 147 additions and 196 deletions
|
@ -45,11 +45,18 @@ struct _CcRemovableMediaSettings
|
|||
{
|
||||
AdwPreferencesGroup parent;
|
||||
|
||||
GtkWidget *cd_audio_row;
|
||||
GtkWidget *dvd_video_row;
|
||||
GtkWidget *music_player_row;
|
||||
GtkWidget *photos_row;
|
||||
GtkWidget *software_row;
|
||||
GtkWidget *other_media_row;
|
||||
|
||||
GtkSwitch *autorun_never_switch;
|
||||
|
||||
GtkAppChooserButton *audio_cdda_chooser;
|
||||
GtkCheckButton *autorun_never_checkbutton;
|
||||
GtkAppChooserButton *dcf_chooser;
|
||||
GtkButton *extra_options_button;
|
||||
GtkBox *handlers_box;
|
||||
GtkAppChooserButton *music_player_chooser;
|
||||
GtkDialog *other_type_dialog;
|
||||
GtkLabel *other_action_label;
|
||||
|
@ -469,13 +476,43 @@ info_panel_setup_media (CcRemovableMediaSettings *self)
|
|||
|
||||
g_settings_bind (self->settings,
|
||||
PREF_MEDIA_AUTORUN_NEVER,
|
||||
self->autorun_never_checkbutton,
|
||||
self->autorun_never_switch,
|
||||
"active",
|
||||
G_SETTINGS_BIND_DEFAULT);
|
||||
|
||||
g_settings_bind (self->settings,
|
||||
PREF_MEDIA_AUTORUN_NEVER,
|
||||
self->handlers_box,
|
||||
self->cd_audio_row,
|
||||
"sensitive",
|
||||
G_SETTINGS_BIND_INVERT_BOOLEAN);
|
||||
|
||||
g_settings_bind (self->settings,
|
||||
PREF_MEDIA_AUTORUN_NEVER,
|
||||
self->dvd_video_row,
|
||||
"sensitive",
|
||||
G_SETTINGS_BIND_INVERT_BOOLEAN);
|
||||
|
||||
g_settings_bind (self->settings,
|
||||
PREF_MEDIA_AUTORUN_NEVER,
|
||||
self->music_player_row,
|
||||
"sensitive",
|
||||
G_SETTINGS_BIND_INVERT_BOOLEAN);
|
||||
|
||||
g_settings_bind (self->settings,
|
||||
PREF_MEDIA_AUTORUN_NEVER,
|
||||
self->photos_row,
|
||||
"sensitive",
|
||||
G_SETTINGS_BIND_INVERT_BOOLEAN);
|
||||
|
||||
g_settings_bind (self->settings,
|
||||
PREF_MEDIA_AUTORUN_NEVER,
|
||||
self->software_row,
|
||||
"sensitive",
|
||||
G_SETTINGS_BIND_INVERT_BOOLEAN);
|
||||
|
||||
g_settings_bind (self->settings,
|
||||
PREF_MEDIA_AUTORUN_NEVER,
|
||||
self->other_media_row,
|
||||
"sensitive",
|
||||
G_SETTINGS_BIND_INVERT_BOOLEAN);
|
||||
}
|
||||
|
@ -513,10 +550,9 @@ cc_removable_media_settings_class_init (CcRemovableMediaSettingsClass *klass)
|
|||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/applications/cc-removable-media-settings.ui");
|
||||
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, audio_cdda_chooser);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, autorun_never_checkbutton);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, autorun_never_switch);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, dcf_chooser);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, extra_options_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, handlers_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, music_player_chooser);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, other_type_dialog);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, other_action_box);
|
||||
|
@ -525,6 +561,12 @@ cc_removable_media_settings_class_init (CcRemovableMediaSettingsClass *klass)
|
|||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, other_type_list_store);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, software_chooser);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, video_dvd_chooser);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, cd_audio_row);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, dvd_video_row);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, music_player_row);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, photos_row);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, software_row);
|
||||
gtk_widget_class_bind_template_child (widget_class, CcRemovableMediaSettings, other_media_row);
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, on_extra_options_dialog_close_request);
|
||||
gtk_widget_class_bind_template_callback (widget_class, on_extra_options_button_clicked);
|
||||
|
|
|
@ -4,198 +4,107 @@
|
|||
<template class="CcRemovableMediaSettings" parent="AdwPreferencesGroup">
|
||||
<property name="title" translatable="yes">Removable Media</property>
|
||||
<property name="description" translatable="yes">Apps which are launched when media or drives are connected</property>
|
||||
<child type="content">
|
||||
<object class="AdwClamp">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="margin_top">32</property>
|
||||
<property name="margin_bottom">32</property>
|
||||
<property name="margin_start">24</property>
|
||||
<property name="margin_end">24</property>
|
||||
<property name="spacing">18</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="handlers_box">
|
||||
<property name="spacing">10</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="vexpand">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">18</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="hexpand">True</property>
|
||||
<property name="column-spacing">6</property>
|
||||
<property name="row-spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">CD _audio</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">audio_cdda_chooser</property>
|
||||
<layout>
|
||||
<property name="row">0</property>
|
||||
<property name="column">0</property>
|
||||
</layout>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">_DVD video</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">video_dvd_chooser</property>
|
||||
<layout>
|
||||
<property name="row">1</property>
|
||||
<property name="column">0</property>
|
||||
</layout>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAppChooserButton" id="audio_cdda_chooser">
|
||||
<property name="hexpand">True</property>
|
||||
<property name="content_type">x-content/audio-cdda</property>
|
||||
<layout>
|
||||
<property name="row">0</property>
|
||||
<property name="column">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAppChooserButton" id="video_dvd_chooser">
|
||||
<property name="hexpand">True</property>
|
||||
<property name="content_type">x-content/video-dvd</property>
|
||||
<layout>
|
||||
<property name="row">1</property>
|
||||
<property name="column">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">_Music player</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">music_player_chooser</property>
|
||||
<layout>
|
||||
<property name="row">2</property>
|
||||
<property name="column">0</property>
|
||||
</layout>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAppChooserButton" id="music_player_chooser">
|
||||
<property name="hexpand">True</property>
|
||||
<property name="content_type">x-content/audio-player</property>
|
||||
<layout>
|
||||
<property name="row">2</property>
|
||||
<property name="column">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">_Photos</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">dcf_chooser</property>
|
||||
<layout>
|
||||
<property name="row">3</property>
|
||||
<property name="column">0</property>
|
||||
</layout>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAppChooserButton" id="dcf_chooser">
|
||||
<property name="hexpand">True</property>
|
||||
<property name="content_type">x-content/image-dcf</property>
|
||||
<layout>
|
||||
<property name="row">3</property>
|
||||
<property name="column">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">_Software</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">software_chooser</property>
|
||||
<layout>
|
||||
<property name="row">4</property>
|
||||
<property name="column">0</property>
|
||||
</layout>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAppChooserButton" id="software_chooser">
|
||||
<property name="hexpand">True</property>
|
||||
<property name="content_type">x-content/unix-software</property>
|
||||
<layout>
|
||||
<property name="row">4</property>
|
||||
<property name="column">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="extra_options_button">
|
||||
<property name="label" translatable="yes">_Other Media…</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="on_extra_options_button_clicked" object="CcRemovableMediaSettings" swapped="yes"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="autorun_never_checkbutton">
|
||||
<property name="valign">end</property>
|
||||
<property name="vexpand">False</property>
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="use_underline">True</property>
|
||||
<property name="label" translatable="yes">_Never prompt or start apps on media insertion</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwActionRow" id="disable_autostart_row">
|
||||
<property name="title" translatable="yes">D_isable Autostart</property>
|
||||
<property name="subtitle" translatable="yes">Never prompt or start programs on media insertion</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="autorun_never_switch">
|
||||
<property name="receives_default">False</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwActionRow" id="cd_audio_row">
|
||||
<property name="title" translatable="yes">CD _audio</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child>
|
||||
<object class="GtkAppChooserButton" id="audio_cdda_chooser">
|
||||
<property name="valign">center</property>
|
||||
<property name="content_type">x-content/audio-cdda</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwActionRow" id="dvd_video_row">
|
||||
<property name="title" translatable="yes">_DVD video</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child>
|
||||
<object class="GtkAppChooserButton" id="video_dvd_chooser">
|
||||
<property name="valign">center</property>
|
||||
<property name="content_type">x-content/video-dvd</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwActionRow" id="music_player_row">
|
||||
<property name="title" translatable="yes">_Music player</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child>
|
||||
<object class="GtkAppChooserButton" id="music_player_chooser">
|
||||
<property name="valign">center</property>
|
||||
<property name="content_type">x-content/audio-player</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwActionRow" id="photos_row">
|
||||
<property name="title" translatable="yes">_Photos</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child>
|
||||
<object class="GtkAppChooserButton" id="dcf_chooser">
|
||||
<property name="valign">center</property>
|
||||
<property name="content_type">x-content/image-dcf</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwActionRow" id="software_row">
|
||||
<property name="title" translatable="yes">_Software</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child>
|
||||
<object class="GtkAppChooserButton" id="software_chooser">
|
||||
<property name="valign">center</property>
|
||||
<property name="content_type">x-content/unix-software</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwActionRow" id="other_media_row">
|
||||
<property name="title" translatable="yes">_Other Media…</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="extra_options_button">
|
||||
<property name="label" translatable="yes">_Configure action</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="on_extra_options_button_clicked" object="CcRemovableMediaSettings" swapped="yes"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
|
||||
<object class="GtkSizeGroup">
|
||||
<widgets>
|
||||
<widget name="audio_cdda_chooser"/>
|
||||
<widget name="video_dvd_chooser"/>
|
||||
<widget name="music_player_chooser"/>
|
||||
<widget name="dcf_chooser"/>
|
||||
<widget name="software_chooser"/>
|
||||
<widget name="extra_options_button"/>
|
||||
</widgets>
|
||||
</object>
|
||||
|
||||
<object class="AdwWindow" id="other_type_dialog">
|
||||
<property name="resizable">False</property>
|
||||
<property name="modal">True</property>
|
||||
|
|
Loading…
Add table
Reference in a new issue