Method: Eiwaji::MainWindow#initialize

Defined in:
lib/mainwindow.rb

#initialize(parent = nil) ⇒ MainWindow

Returns a new instance of MainWindow.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/mainwindow.rb', line 17

def initialize(parent = nil)
  super(parent)

  if find_executable0('mecab') == nil
    Qt::MessageBox.critical(self, tr("Mecab not installed"),
              tr("An installation of mecab was not detected. " +
                 "Text analysis will not function properly."))
  end

  @ui = Ui_MainWindow.new
  @ui.setupUi(self)

  @settings ||= Qt::Settings.new(Eiwaji::Constants::CONFIG_PATH, Qt::Settings::IniFormat)
  if not File.exists? Eiwaji::Constants::CONFIG_PATH
    writeConfig
  end
  readConfig

  initClipboard()
  createActions()
  createMenus()
  createStatusBar()
  createDockWindows()

  setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }")
end