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




305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/taskwin.rb', line 305

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



336
337
338
339
340
341
342
343
344
# File 'lib/taskwin.rb', line 336

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



346
347
348
# File 'lib/taskwin.rb', line 346

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

#readSettingsObject



329
330
331
332
# File 'lib/taskwin.rb', line 329

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

#writeSettingsObject



324
325
326
327
# File 'lib/taskwin.rb', line 324

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