Project

General

Profile

機能 #595 » 0001-.patch

Satoshi Okuno, 2013-06-30 21:13

View differences:

core/mui/gtk_keyconfig.rb
37 37
    button = Gtk::Button.new
38 38
    dialog = Gtk::Dialog.new(title, self.get_ancestor(Gtk::Window), Gtk::Dialog::MODAL,
39 39
                             [ Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK])
40

  
41
    radio_keybind = ::Gtk::RadioButton.new('キーバインド')
42
    radio_dclick = ::Gtk::RadioButton.new(radio_keybind, 'ダブルクリック')
43

  
44
    radio_keybind.ssc(:clicked){
45
      keycode = ""
46
      buttonlabel.text = label.text = keycode
47
      button.sensitive = true
48
      self.change_hook.call(keycode) if self.change_hook
49
    }
50

  
51
    radio_dclick.ssc(:clicked){
52
      keycode = "Double_Click"
53
      buttonlabel.text = label.text = keycode
54
      button.sensitive = false
55
      self.change_hook.call(keycode) if self.change_hook
56
    }
57

  
58
    if keycode == "Double_Click"
59
      button.sensitive = false
60
      radio_dclick.active = true
61
    else
62
      button.sensitive = true
63
      radio_keybind.active = true
64
    end
65

  
40 66
    label.text = keycode
67

  
41 68
    box.border_width = 20
42 69
    button.add(label)
43 70
    box.pack_start(Gtk::Label.new('下のボタンをクリックして、割り当てたいキーを押してください。'))
71
    box.pack_start(radio_keybind)
44 72
    box.pack_start(button)
73
    box.pack_start(radio_dclick)
45 74
    button.signal_connect('key_press_event', &key_set(label))
46 75
    dialog.vbox.add(box)
47 76
    dialog.show_all
core/plugin/gtk/gtk.rb
175 175
    timeline = ::Gtk::TimeLine.new(i_timeline)
176 176
    @slug_dictionary.add(i_timeline, timeline)
177 177
    handler = {
178
      button_press_event: lambda { |widget, event| 
179
        if event.event_type.name == "GDK_2BUTTON_PRESS" then
180
          Plugin::GUI.keypress("Double_Click", i_timeline) 
181
        end
182
      },
183
      key_press_event: timeline_key_press_event(i_timeline),
178 184
      key_press_event: timeline_key_press_event(i_timeline),
179 185
      focus_in_event: timeline_focus_in_event(i_timeline),
180 186
      destroy: lambda{ |this| timeline_hook_events(timeline, handler) } }
core/plugin/shortcutkey/shortcutkey_listview.rb
109 109
      btn_cancel.ssc(:clicked){ window.destroy }
110 110
      btn_ok.ssc(:clicked){
111 111
        error = catch(:validate) {
112
          throw :validate, "キーバインドを選択してください" unless values[COLUMN_KEYBIND]
112
          throw :validate, "キーバインドを選択してください" unless (values[COLUMN_KEYBIND] && values[COLUMN_KEYBIND] != "")
113

  
113 114
          throw :validate, "コマンドを選択してください" unless values[COLUMN_SLUG]
114 115
          result = values
115 116
          window.destroy }
116
- 
(1-1/2)