class ApplicationsTab

Public Class Methods

new(fileInfo, parent = nil) click to toggle source
Calls superclass method
# File examples/dialogs/tabdialog/tabdialog.rb, line 153
def initialize(fileInfo, parent = nil)
    super(parent)
    topLabel = Qt::Label.new(tr("Open with:"))

    applicationsListBox = Qt::ListWidget.new
    applications = []
    (1..30).each do |i|
        applications.push tr("Application %d" % i)
    end
    applicationsListBox.insertItems(0, applications)

    if fileInfo.suffix.nil?
        alwaysCheckBox = Qt::CheckBox.new(tr("Always use this application to " +
            "open this type of file"))
    else
        alwaysCheckBox = Qt::CheckBox.new(tr("Always use this application to " +
            "open files with the extension '%s'" % fileInfo.suffix()))
    end

    self.layout = Qt::VBoxLayout.new do |l|
        l.addWidget(topLabel)
        l.addWidget(applicationsListBox)
        l.addWidget(alwaysCheckBox)
    end
end