Class: TaskWindow

Inherits:
Qt::Widget
  • Object
show all
Defined in:
lib/taskwin.rb

Overview


Task Window

Defined Under Namespace

Classes: Item, TaskItem, TaskTable

Constant Summary collapse

SOURCE =

column

0
FILE =
1
LAPSE =
2
STATUS =
3
GroupName =
"TaskWindow"

Instance Method Summary collapse

Constructor Details

#initializeTaskWindow




318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/taskwin.rb', line 318

def initialize()
    super

    # create widgets
    tvLayout = Qt::VBoxLayout.new
    @table = TaskTable.new
    tvLayout.addWidget(@table)
    @table.setHorizontalHeaderLabels(['Source', 'File', 'Lapse', 'Status'])
    @table.horizontalHeader.stretchLastSection = true
    @table.selectionBehavior = Qt::AbstractItemView::SelectRows
    @table.alternatingRowColors = true

    setLayout(tvLayout)

    # initialize variables
    #
end

Instance Method Details

#addTask(process) ⇒ Object



349
350
351
352
353
354
355
356
357
# File 'lib/taskwin.rb', line 349

def addTask(process)
    # insert at the top
    src = process.sourceUrl
    save = process.rawFileName
    taskItem = TaskItem.new(process, src, save, 0, 'prepare')
    @table.insertTaskItem(taskItem)

    taskItem
end

#each(&block) ⇒ Object



359
360
361
# File 'lib/taskwin.rb', line 359

def each(&block)
    @table.each(&block)
end

#readSettingsObject



342
343
344
345
# File 'lib/taskwin.rb', line 342

def readSettings
    config = $config.group(GroupName)
    @table.horizontalHeader.restoreState(config.readEntry('Header', @table.horizontalHeader.saveState))
end

#writeSettingsObject



337
338
339
340
# File 'lib/taskwin.rb', line 337

def writeSettings
    config = $config.group(GroupName)
    config.writeEntry('Header', @table.horizontalHeader.saveState)
end