Module: Smartdict::Gui

Extended by:
ActiveSupport::Autoload, Gui
Included in:
Gui, InterchangeButton, LangComboBox
Defined in:
lib/smartdict/gui.rb,
lib/smartdict/gui/version.rb,
lib/smartdict/gui/menu_bar.rb,
lib/smartdict/gui/controller.rb,
lib/smartdict/gui/word_entry.rb,
lib/smartdict/gui/status_icon.rb,
lib/smartdict/gui/translate_button.rb

Defined Under Namespace

Classes: AboutWindow, Cli, Controller, ExportDialog, InterchangeButton, LangComboBox, MainWindow, MenuBar, StatusBar, StatusIcon, TextView, TranslateButton, WordEntry, WordList

Constant Summary collapse

LEFT_BOX_BUTTON_HEIGHT =
36
VERSION =
File.read(File.join(Smartdict::Gui.root_dir, "VERSION")).strip

Instance Method Summary collapse

Instance Method Details

#root_dirObject



43
44
45
# File 'lib/smartdict/gui.rb', line 43

def root_dir
  File.join(File.dirname(__FILE__), '../..')
end

#runObject



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/smartdict/gui.rb', line 29

def run
  if running?
    puts "smartdict-gtk is already running. PID=#{running_pid}"
    Process.kill("USR1", running_pid)
  else
    File.write(pid_file, Process.pid.to_s)
    controller = Smartdict::Gui::Controller.new
    Signal.trap("USR1") do
      controller.show_visibility
    end
    controller.run
  end
end