From: Ben Hutchings Date: Sun, 3 Dec 2006 01:07:58 +0000 (+0000) Subject: Implemented some keyboard commands in preview mode. X-Git-Tag: 1.2~11 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=videolink.git;a=commitdiff_plain;h=848b64a0be9d0fb5fbff354796f91a042a5dd4c1 Implemented some keyboard commands in preview mode. --- diff --git a/README b/README index e731c65..d7b003c 100644 --- 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 468f292..0fc7806 100644 --- 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. diff --git a/videolink.cpp b/videolink.cpp index 4e9fa6b..ca41933 100644 --- a/videolink.cpp +++ b/videolink.cpp @@ -15,6 +15,7 @@ #include +#include #include #include #include @@ -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: