]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Optimization for GUI LiveCD
authorlongpanda <admin@ventoy.net>
Thu, 30 Sep 2021 05:40:48 +0000 (13:40 +0800)
committerlongpanda <admin@ventoy.net>
Thu, 30 Sep 2021 05:40:48 +0000 (13:40 +0800)
INSTALL/tool/VentoyGTK.glade
INSTALL/tool/aarch64/Ventoy2Disk.gtk3
INSTALL/tool/i386/Ventoy2Disk.gtk2
INSTALL/tool/i386/Ventoy2Disk.gtk3
INSTALL/tool/mips64el/Ventoy2Disk.gtk3
INSTALL/tool/x86_64/Ventoy2Disk.gtk2
INSTALL/tool/x86_64/Ventoy2Disk.gtk3
LinuxGUI/Ventoy2Disk/GTK/ventoy_gtk.c

index ecf0500a7ffbf1b8b682b41d7c8a209b734f7bef..d04185706c167158968e3059d73f93d177cd39ab 100644 (file)
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
+                    <property name="has_default">True</property>
                     <property name="image">image_refresh</property>
                   </object>
                   <packing>
             <property name="width_request">100</property>
             <property name="height_request">40</property>
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
+            <property name="can_focus">True</property>            
             <property name="receives_default">True</property>
           </object>
           <packing>
index c513b25a17212a6b2611e005f6f15a9a6ed2aacf..5692a5d7f9d5bc442277c5059396876c34ebe09e 100644 (file)
Binary files a/INSTALL/tool/aarch64/Ventoy2Disk.gtk3 and b/INSTALL/tool/aarch64/Ventoy2Disk.gtk3 differ
index 16a87d4965507fc21f29ec3b94f27ff1ad6054c7..9360d8b848fcb5991f8a4a4fd9f22d13d094e939 100644 (file)
Binary files a/INSTALL/tool/i386/Ventoy2Disk.gtk2 and b/INSTALL/tool/i386/Ventoy2Disk.gtk2 differ
index 49d18beef1e2d491e51e548aa2a58c0fe539dc81..90a52077abfdaada9e4de657cd6a89e15e52c9ec 100644 (file)
Binary files a/INSTALL/tool/i386/Ventoy2Disk.gtk3 and b/INSTALL/tool/i386/Ventoy2Disk.gtk3 differ
index f8e32876cd6d5bc0687f2658a9e717a605d4b17b..0e1d81bfb1f546d65f5a8be905c11b8d0b2973c3 100644 (file)
Binary files a/INSTALL/tool/mips64el/Ventoy2Disk.gtk3 and b/INSTALL/tool/mips64el/Ventoy2Disk.gtk3 differ
index 371f1e34012164a88a9b70fd8e57d9dc14421f8d..717db106e99208abc890b544503891222582b7fd 100644 (file)
Binary files a/INSTALL/tool/x86_64/Ventoy2Disk.gtk2 and b/INSTALL/tool/x86_64/Ventoy2Disk.gtk2 differ
index 493e8aa0892f4251519275668e5ba8b18eeda470..6e70312373b1e40fb684d91d61e0ccd8ef99e242 100644 (file)
Binary files a/INSTALL/tool/x86_64/Ventoy2Disk.gtk3 and b/INSTALL/tool/x86_64/Ventoy2Disk.gtk3 differ
index b86d4fbc9acf8d840586fe6672b39a71ca55f19c..a1ef3dc281ddba43cb2eb1fc68b77ba7779c5c69 100644 (file)
@@ -35,6 +35,7 @@
 #include <ventoy_http.h>
 
 #include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
 #include "ventoy_gtk.h"
 
 int g_secure_boot_support = 0;
@@ -494,12 +495,12 @@ void on_clear_ventoy(GtkMenuItem *menuItem, gpointer data)
         return;
     }
 
-    if (GTK_RESPONSE_CANCEL == msgbox(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, "STR_INSTALL_TIP"))
+    if (GTK_RESPONSE_OK != msgbox(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, "STR_INSTALL_TIP"))
     {
         return;
     }
 
-    if (GTK_RESPONSE_CANCEL == msgbox(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, "STR_INSTALL_TIP2"))
+    if (GTK_RESPONSE_OK != msgbox(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, "STR_INSTALL_TIP2"))
     {
         return;
     }
@@ -687,12 +688,12 @@ void on_button_install_clicked(GtkWidget *widget, gpointer data)
        }
     }
 
-    if (GTK_RESPONSE_CANCEL == msgbox(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, "STR_INSTALL_TIP"))
+    if (GTK_RESPONSE_OK != msgbox(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, "STR_INSTALL_TIP"))
     {
         return;
     }
 
-    if (GTK_RESPONSE_CANCEL == msgbox(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, "STR_INSTALL_TIP2"))
+    if (GTK_RESPONSE_OK != msgbox(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, "STR_INSTALL_TIP2"))
     {
         return;
     }
@@ -788,7 +789,7 @@ void on_button_update_clicked(GtkWidget *widget, gpointer data)
         return;
     }
 
-    if (GTK_RESPONSE_CANCEL == msgbox(GTK_MESSAGE_INFO, GTK_BUTTONS_OK_CANCEL, "STR_UPDATE_TIP"))
+    if (GTK_RESPONSE_OK != msgbox(GTK_MESSAGE_INFO, GTK_BUTTONS_OK_CANCEL, "STR_UPDATE_TIP"))
     {
         return;
     }
@@ -1020,9 +1021,16 @@ static void init_part_cfg_window(GtkBuilder *pBuilder)
     SIGNAL("part_cfg_dlg", "delete_event", on_part_cfg_close);
 }
 
+static void add_accelerator(GtkAccelGroup *agMain, void *widget, const char *signal, guint accel_key)
+{
+    gtk_widget_add_accelerator(GTK_WIDGET(widget), signal, agMain, accel_key, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+    gtk_widget_add_accelerator(GTK_WIDGET(widget), signal, agMain, accel_key, GDK_SHIFT_MASK | GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+}
+
 void on_init_window(GtkBuilder *pBuilder)
 {
     GSList *pGroup = NULL;
+    GtkAccelGroup *agMain = NULL;
     char version[512];
 
     vlog("on_init_window ...\n");
@@ -1096,6 +1104,13 @@ void on_init_window(GtkBuilder *pBuilder)
     SIGNAL("menu_item_part_cfg", "activate",  on_part_config);
     SIGNAL("menu_item_clear", "activate",  on_clear_ventoy);
 
+    agMain = gtk_accel_group_new();
+    gtk_window_add_accel_group(GTK_WINDOW(g_topWindow), agMain);
+    add_accelerator(agMain, g_dev_combobox,   "popup",   GDK_KEY_d);
+    add_accelerator(agMain, g_install_button, "clicked", GDK_KEY_i);
+    add_accelerator(agMain, g_update_button,  "clicked", GDK_KEY_u);
+    add_accelerator(agMain, g_refresh_button, "clicked", GDK_KEY_r);
+
     fill_dev_list(NULL);
 
     return;