Commit 922e0c1d authored by Maoschanz's avatar Maoschanz Committed by Kai Lüke

Update the UI to match current guidelines

parent 97957f61
......@@ -315,6 +315,23 @@ attach_disk_image_activated (GSimpleAction *action,
gdu_window_show_attach_disk_image (app->window);
}
static void
shortcuts_activated (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GduApplication *app = GDU_APPLICATION (user_data);
GtkWidget *dialog;
dialog = GTK_WIDGET (gdu_application_new_widget (app,
"shortcuts.ui",
"shortcuts",
NULL));
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (app->window));
gtk_widget_show_all (dialog);
}
static void
about_activated (GSimpleAction *action,
GVariant *parameter,
......@@ -377,8 +394,9 @@ static GActionEntry app_entries[] =
{
{ "new_disk_image", new_disk_image_activated, NULL, NULL, NULL },
{ "attach_disk_image", attach_disk_image_activated, NULL, NULL, NULL },
{ "about", about_activated, NULL, NULL, NULL },
{ "shortcuts", shortcuts_activated, NULL, NULL, NULL },
{ "help", help_activated, NULL, NULL, NULL },
{ "about", about_activated, NULL, NULL, NULL },
{ "quit", quit_activated, NULL, NULL, NULL }
};
......@@ -386,21 +404,33 @@ static void
gdu_application_startup (GApplication *_app)
{
GduApplication *app = GDU_APPLICATION (_app);
GMenuModel *app_menu;
GtkBuilder *builder;
const gchar **it;
const gchar *action_accels[] = {
"win.open-drive-menu", "F10", NULL,
"win.open-volume-menu", "<Shift>F10", NULL,
"win.format-disk", "<Primary>D", NULL,
"win.restore-disk-image", "<Primary>R", NULL,
"win.view-smart", "<Primary>S", NULL,
"win.disk-settings", "<Primary>E", NULL,
"win.format-partition", "<Primary>P", NULL,
"app.new_disk_image", "<Primary>N", NULL,
"app.attach_disk_image", "<Primary>A", NULL,
"app.help", "F1", NULL,
"app.quit", "<Primary>Q", NULL,
NULL
};
if (G_APPLICATION_CLASS (gdu_application_parent_class)->startup != NULL)
G_APPLICATION_CLASS (gdu_application_parent_class)->startup (_app);
g_action_map_add_action_entries (G_ACTION_MAP (app), app_entries, G_N_ELEMENTS (app_entries), app);
app_menu = G_MENU_MODEL (gdu_application_new_widget (app,
"app-menu.ui",
"app-menu",
&builder));
gtk_application_set_app_menu (GTK_APPLICATION (app), app_menu);
g_object_unref (app_menu);
g_clear_object (&builder);
for (it = action_accels; it[0] != NULL; it += g_strv_length ((gchar **)it) + 1)
gtk_application_set_accels_for_action (GTK_APPLICATION (app), it[0], &it[1]);
}
/* ---------------------------------------------------------------------------------------------------- */
......
This diff is collapsed.
......@@ -8,11 +8,13 @@
<file preprocess="xml-stripblanks">ui/create-confirm-page.ui</file>
<file preprocess="xml-stripblanks">ui/create-disk-image-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/create-filesystem-page.ui</file>
<file preprocess="xml-stripblanks">ui/create-format.ui</file>
<file preprocess="xml-stripblanks">ui/create-other-page.ui</file>
<file preprocess="xml-stripblanks">ui/create-partition-page.ui</file>
<file preprocess="xml-stripblanks">ui/create-password-page.ui</file>
<file preprocess="xml-stripblanks">ui/disk-settings-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/disks.ui</file>
<file preprocess="xml-stripblanks">ui/drive-menu.ui</file>
<file preprocess="xml-stripblanks">ui/edit-crypttab-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/edit-dos-partition-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/edit-filesystem-dialog.ui</file>
......@@ -21,12 +23,14 @@
<file preprocess="xml-stripblanks">ui/edit-partition-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/erase-multiple-disks-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/format-disk-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/create-format.ui</file>
<file preprocess="xml-stripblanks">ui/headerbar.ui</file>
<file preprocess="xml-stripblanks">ui/new-disk-image-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/resize-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/restore-disk-image-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/shortcuts.ui</file>
<file preprocess="xml-stripblanks">ui/smart-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/unlock-device-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/volume-menu.ui</file>
<file>ui/gdu.css</file>
</gresource>
</gresources>
......@@ -7,24 +7,22 @@
<attribute name="action">app.new_disk_image</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Attach Disk _Image…</attribute>
<attribute name="label" translatable="yes">_Attach Disk Image… (.iso, .img)</attribute>
<attribute name="action">app.attach_disk_image</attribute>
</item>
</section>
<section>
<item>
<attribute name="action">app.help</attribute>
<attribute name="label" translatable="yes">_Help</attribute>
<attribute name="accel">F1</attribute>
<attribute name="action">app.shortcuts</attribute>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About</attribute>
<attribute name="action">app.about</attribute>
<attribute name="action">app.help</attribute>
<attribute name="label" translatable="yes">_Help</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
<attribute name="label" translatable="yes">_About Disks</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
</menu>
......
......@@ -13,10 +13,11 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkHPaned" id="main-hpane">
<object class="GtkPaned" id="main-hpane">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="position">250</property>
<property name="orientation">horizontal</property>
<property name="position">200</property>
<property name="position_set">True</property>
<child>
<object class="GtkScrolledWindow" id="device-tree-scrolledwindow">
......@@ -789,7 +790,7 @@
</packing>
</child>
<child>
<object class="GtkToolButton" id="toolbutton-generic-menu">
<object class="GtkToolButton" id="toolbutton-volume-menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Additional partition options</property>
......@@ -1161,215 +1162,4 @@
</object>
</child>
</object>
<object class="GtkMenu" id="generic-drive-menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<child>
<object class="GtkMenuItem" id="generic-drive-menu-item-format-disk">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Format Disk…</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="menuitem4">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-drive-menu-item-create-disk-image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Create Disk Image…</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-drive-menu-item-restore-disk-image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Restore Disk Image…</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-drive-menu-item-benchmark">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Benchmark Disk…</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="generic-drive-menu-item-drive-sep-1">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-drive-menu-item-view-smart">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">SMART Data &amp; Self-Tests…</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-drive-menu-item-disk-settings">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Drive Settings…</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="generic-drive-menu-item-drive-sep-2">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-drive-menu-item-standby-now">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Standby Now</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-drive-menu-item-resume-now">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Wake-Up from Standby</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-drive-menu-item-power-off">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Power Off…</property>
<property name="use_underline">True</property>
</object>
</child>
</object>
<object class="GtkMenu" id="generic-menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<child>
<object class="GtkMenuItem" id="generic-menu-item-format-volume">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Format Partition…</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="menuitem3">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-menu-item-edit-partition">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Edit Partition…</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-menu-item-edit-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Edit Filesystem…</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-menu-item-change-passphrase">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Change Passphrase…</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="menuitem2">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-menu-item-resize">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Resize…</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-menu-item-check">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Check Filesystem…</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-menu-item-repair">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Repair Filesystem…</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="generic-menu-item-separator">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-menu-item-configure-fstab">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Edit Mount Options…</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-menu-item-configure-crypttab">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Edit Encryption Options…</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="menuitem1">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-menu-item-create-volume-image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Create Partition Image…</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-menu-item-restore-volume-image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Restore Partition Image…</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="generic-menu-item-benchmark">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Benchmark Partition…</property>
</object>
</child>
</object>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<menu id='drive-menu'>
<section>
<item>
<attribute name="label" translatable="yes">Format _Disk…</attribute>
<attribute name="action">win.format-disk</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Create Disk Image…</attribute>
<attribute name="action">win.create-disk-image</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Restore Disk Image…</attribute>
<attribute name="action">win.restore-disk-image</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Benchmark Disk…</attribute>
<attribute name="action">win.benchmark-disk</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_SMART Data &amp; Self-Tests…</attribute>
<attribute name="action">win.view-smart</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Drive S_ettings…</attribute>
<attribute name="action">win.disk-settings</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">S_tandby Now</attribute>
<attribute name="action">win.standby-now</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Wake-Up from Standby</attribute>
<attribute name="action">win.resume-now</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Power Off</attribute>
<attribute name="action">win.power-off</attribute>
</item>
</section>
</menu>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.10 -->
<object class="GtkPaned" id="headerbar-paned">
<property name="orientation">horizontal</property>
<property name="position">200</property>
<child>
<object class="GtkHeaderBar" id="disks-side-headerbar">
<property name="can_focus">False</property>
<property name="title">Disks</property>
<property name="show-close-button">True</property>
<child>
<object class="GtkMenuButton" id="app-menu-button">
<property name="visible">True</property>
<property name="direction">none</property>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
<packing>
<property name="resize">False</property>
<!-- XXX -->
<!-- <property name="shrink">False</property> -->
</packing>
</child>
<child>
<object class="GtkHeaderBar" id="disks-main-headerbar">
<property name="can_focus">False</property>
<property name="show-close-button">True</property>
<child>
<object class="GtkMenuButton" id="drive-menu-button">
<property name="visible">True</property>
<property name="tooltip-text" translatable="yes">Drive Options</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">view-more-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
<child>
<object class="GtkButton" id="power-off-disk-button">
<property name="visible">True</property>
<property name="tooltip-text" translatable="yes">Power off this disk</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">system-shutdown-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
<child>
<object class="GtkButton" id="eject-disk-button">
<property name="visible">True</property>
<property name="tooltip-text" translatable="yes">Eject this disk</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">media-eject-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
<child>
<object class="GtkButton" id="detach-loop-device-button">
<property name="visible">True</property>
<property name="tooltip-text" translatable="yes">Detach this loop device</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">list-remove-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkShortcutsWindow" id="shortcuts">
<property name="modal">True</property>
<child>
<object class="GtkShortcutsSection">
<property name="visible">True</property>
<property name="section-name">shortcuts</property>
<property name="max-height">10</property>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">General</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Create a new empty disk image</property>
<property name="accelerator">&lt;Primary&gt;n</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Attach an existing disk image</property>
<property name="accelerator">&lt;Primary&gt;a</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Help</property>
<property name="accelerator">F1</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Quit</property>
<property name="accelerator">&lt;Primary&gt;q</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Drive</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Open the drive menu</property>
<property name="accelerator">F10</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Format the drive</property>
<property name="accelerator">&lt;Primary&gt;d</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Restore an image to the disk</property>
<property name="accelerator">&lt;Primary&gt;r</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">SMART data</property>
<property name="accelerator">&lt;Primary&gt;s</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Drive settings</property>
<property name="accelerator">&lt;Primary&gt;e</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkShortcutsGroup">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Partition</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Open the volume menu</property>
<property name="accelerator">&lt;Shift&gt;F10</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Format the selected volume</property>
<property name="accelerator">&lt;Primary&gt;p</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<menu id='volume-menu'>
<section>
<item>
<attribute name="label" translatable="yes">Format _Partition…</attribute>
<attribute name="action">win.format-partition</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Edit Partition…</attribute>
<attribute name="action">win.edit-partition</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Edit _Filesystem…</attribute>
<attribute name="action">win.edit-label</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Change Pa_ssphrase…</attribute>
<attribute name="action">win.change-passphrase</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Resi_ze…</attribute>
<attribute name="action">win.resize</attribute>
</item>
<item>
<attribute name="label" translatable="yes">C_heck Filesystem…</attribute>
<attribute name="action">win.check-fs</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Rep_air Filesystem…</attribute>
<attribute name="action">win.repair-fs</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Edit _Mount Options…</attribute>
<attribute name="action">win.configure-fstab</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Edit Encr_yption Options…</attribute>
<attribute name="action">win.configure-crypttab</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Create Partition Image…</attribute>
<attribute name="action">win.create-partition-image</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Restore Partition Image…</attribute>
<attribute name="action">win.restore-partition-image</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Benchmark Partition…</attribute>
<attribute name="action">win.benchmark-partition</attribute>
</item>
</section>
</menu>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment