]> git.decadent.org.uk Git - videolink.git/commitdiff
Implemented some keyboard commands in preview mode.
authorBen Hutchings <ben@decadent.org.uk>
Sun, 3 Dec 2006 01:07:58 +0000 (01:07 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 2 Nov 2008 23:58:13 +0000 (23:58 +0000)
README
TODO
videolink.cpp

diff --git a/README b/README
index e731c65b2b4bc26ba0760ee611c27a36889417aa..d7b003c3700e95ad7956fb943bd52560c18714da 100644 (file)
--- a/README
+++ b/README
@@ -98,6 +98,8 @@ To get a rough preview of the menus, run "videolink --preview menu-url"
 where menu-url is the URL or filename of the first page to show.
 Currently videos cannot be displayed in this preview mode.
 
+Press T to go to the "top" (main) menu or Q to quit.
+
 Processing
 
 To create a DVD filesystem, run "videolink menu-url output-dir" where
diff --git a/TODO b/TODO
index 468f2929144c9d71ba54ffc93687d7d25cc71a04..0fc7806ae721f981dcf0100bcfeb2aa322baec63 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,7 +2,6 @@ Priority 1 (highest)
 
 Priority 2
 Use ffmpeg to convert unsuitable video files (how do we check this?).
-Add keyboard command for "top menu" in preview mode.
 Add support for videos in preview mode.
 Support more than 99 titles somehow (grouping them into titlesets won't help)
 Track down and fix/suppress the NS_BINDING_ABORTED (0x804b002) error that occasionally appears in preview mode.
index 4e9fa6b3c27057a7f64f9ae3b0061f274e3da2c7..ca4193370fae8d379ec326b9f5504eb9d37dfd26 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <stdlib.h>
 
+#include <gdk/gdkkeysyms.h>
 #include <gdkmm/pixbuf.h>
 #include <glibmm/convert.h>
 #include <glibmm/spawn.h>
@@ -176,6 +177,7 @@ namespace
 
     private:
        virtual void do_late_initialisation();
+       bool on_key_press(GdkEventKey *);
 
        std::string main_page_uri_;
     };
@@ -185,13 +187,29 @@ namespace
        : base_window(frame_params),
          main_page_uri_(main_page_uri)
     {
+       signal_key_press_event().connect(SigC::slot(*this, &preview_window::on_key_press));
     }
 
     void preview_window::do_late_initialisation()
     {
        browser_widget_.load_uri(main_page_uri_);
     }
-    
+
+    bool preview_window::on_key_press(GdkEventKey * event)
+    {
+       switch (event->keyval)
+       {
+       case GDK_t: // = top menu
+           browser_widget_.load_uri(main_page_uri_);
+           return true;
+       case GDK_q: // = quit
+           Gtk::Main::quit();
+           return true;
+       default:
+           return false;
+       }
+    }
+
     class conversion_window : public base_window
     {
     public: