|
|
|
@ -25,31 +25,31 @@ rescue LoadError
|
|
|
|
|
exit
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
class MainWidget < Qt::Dialog
|
|
|
|
|
class MainWidget < TQt::Dialog
|
|
|
|
|
|
|
|
|
|
slots 'accept()'
|
|
|
|
|
|
|
|
|
|
def initialize(parent = nil, name = nil)
|
|
|
|
|
super
|
|
|
|
|
|
|
|
|
|
box = Qt::VBoxLayout.new( self, 11, 6 );
|
|
|
|
|
box = TQt::VBoxLayout.new( self, 11, 6 );
|
|
|
|
|
|
|
|
|
|
lTitle = Qt::Label.new('soundKonverter plugin settings', self)
|
|
|
|
|
lTitle = TQt::Label.new('soundKonverter plugin settings', self)
|
|
|
|
|
box.addWidget( lTitle )
|
|
|
|
|
lTitle.setAlignment(Qt::AlignCenter)
|
|
|
|
|
font = Qt::Font.new()
|
|
|
|
|
lTitle.setAlignment(TQt::AlignCenter)
|
|
|
|
|
font = TQt::Font.new()
|
|
|
|
|
font.setPixelSize(18)
|
|
|
|
|
font.setBold(true)
|
|
|
|
|
lTitle.setFont(font)
|
|
|
|
|
|
|
|
|
|
box.addSpacing( 5 )
|
|
|
|
|
|
|
|
|
|
mediaDeviceBox = Qt::GroupBox.new( 1, Qt::Vertical, "Options for transfering to media devices", self )
|
|
|
|
|
mediaDeviceBox = TQt::GroupBox.new( 1, TQt::Vertical, "Options for transfering to media devices", self )
|
|
|
|
|
box.addWidget( mediaDeviceBox )
|
|
|
|
|
mediaDeviceBox.layout().setSpacing( 6 )
|
|
|
|
|
mediaDeviceBox.layout().setMargin( 6 )
|
|
|
|
|
Qt::Label.new('Profile for lossy conversion:', mediaDeviceBox)
|
|
|
|
|
@cTranscodeProfile = Qt::ComboBox.new(mediaDeviceBox)
|
|
|
|
|
TQt::Label.new('Profile for lossy conversion:', mediaDeviceBox)
|
|
|
|
|
@cTranscodeProfile = TQt::ComboBox.new(mediaDeviceBox)
|
|
|
|
|
@cTranscodeProfile.insertItem("Very low")
|
|
|
|
|
@cTranscodeProfile.insertItem("Low")
|
|
|
|
|
@cTranscodeProfile.insertItem("Medium")
|
|
|
|
@ -59,17 +59,17 @@ def initialize(parent = nil, name = nil)
|
|
|
|
|
|
|
|
|
|
# box.addSpacing( 5 )
|
|
|
|
|
#
|
|
|
|
|
# rippingBox = Qt::GroupBox.new( 2, Qt::Horizontal, "Use pre-defined options for CD ripping", self )
|
|
|
|
|
# rippingBox = TQt::GroupBox.new( 2, TQt::Horizontal, "Use pre-defined options for CD ripping", self )
|
|
|
|
|
# box.addWidget( rippingBox )
|
|
|
|
|
# rippingBox.layout().setSpacing( 6 )
|
|
|
|
|
# rippingBox.layout().setMargin( 6 )
|
|
|
|
|
# rippingBox.setCheckable( true )
|
|
|
|
|
# rippingBox.setEnabled( false )
|
|
|
|
|
#
|
|
|
|
|
# profileBox = Qt::HBoxLayout.new( rippingBox, 6 );
|
|
|
|
|
# lRippingProfile = Qt::Label.new('Profile:', rippingBox)
|
|
|
|
|
# profileBox = TQt::HBoxLayout.new( rippingBox, 6 );
|
|
|
|
|
# lRippingProfile = TQt::Label.new('Profile:', rippingBox)
|
|
|
|
|
# profileBox.addWidget( lRippingProfile )
|
|
|
|
|
# @cRippingProfile = Qt::ComboBox.new(rippingBox)
|
|
|
|
|
# @cRippingProfile = TQt::ComboBox.new(rippingBox)
|
|
|
|
|
# profileBox.addWidget( @cRippingProfile )
|
|
|
|
|
# @cRippingProfile.insertItem("Very low")
|
|
|
|
|
# @cRippingProfile.insertItem("Low")
|
|
|
|
@ -79,17 +79,17 @@ def initialize(parent = nil, name = nil)
|
|
|
|
|
# @cRippingProfile.insertItem("Lossless")
|
|
|
|
|
# @cRippingProfile.insertItem("Last used")
|
|
|
|
|
# @cRippingProfile.setCurrentItem(3)
|
|
|
|
|
# lRippingFormat = Qt::Label.new('Format:', rippingBox)
|
|
|
|
|
# lRippingFormat = TQt::Label.new('Format:', rippingBox)
|
|
|
|
|
# profileBox.addWidget( lRippingFormat )
|
|
|
|
|
# @cRippingFormat = Qt::ComboBox.new(rippingBox)
|
|
|
|
|
# @cRippingFormat = TQt::ComboBox.new(rippingBox)
|
|
|
|
|
# profileBox.addWidget( @cRippingFormat )
|
|
|
|
|
# @cRippingFormat.insertItem("ogg")
|
|
|
|
|
# @cRippingFormat.insertItem("mp3")
|
|
|
|
|
# @cRippingFormat.insertItem("flac")
|
|
|
|
|
# directoryBox = Qt::HBoxLayout.new( rippingBox, 6 );
|
|
|
|
|
# lRippingDirectory = Qt::Label.new('Directory:', rippingBox)
|
|
|
|
|
# directoryBox = TQt::HBoxLayout.new( rippingBox, 6 );
|
|
|
|
|
# lRippingDirectory = TQt::Label.new('Directory:', rippingBox)
|
|
|
|
|
# directoryBox.addWidget( lRippingDirectory )
|
|
|
|
|
# @cRippingDirectory = Qt::ComboBox.new(rippingBox)
|
|
|
|
|
# @cRippingDirectory = TQt::ComboBox.new(rippingBox)
|
|
|
|
|
# directoryBox.addWidget( @cRippingDirectory )
|
|
|
|
|
# @cRippingDirectory.setEditable(true)
|
|
|
|
|
# @cRippingDirectory.insertItem("/home/daniel/soundKonverter/%b/%d - %n - %t")
|
|
|
|
@ -97,10 +97,10 @@ def initialize(parent = nil, name = nil)
|
|
|
|
|
|
|
|
|
|
box.addSpacing( 5 )
|
|
|
|
|
|
|
|
|
|
buttonsBox = Qt::HBoxLayout.new(box)
|
|
|
|
|
buttonsBox = TQt::HBoxLayout.new(box)
|
|
|
|
|
buttonsBox.setSpacing(6)
|
|
|
|
|
buttonsBox.addStretch()
|
|
|
|
|
okPushButton = Qt::PushButton.new( self, "ok" )
|
|
|
|
|
okPushButton = TQt::PushButton.new( self, "ok" )
|
|
|
|
|
buttonsBox.addWidget( okPushButton )
|
|
|
|
|
okPushButton.setText( "OK" )
|
|
|
|
|
okPushButton.setDefault( true )
|
|
|
|
@ -109,18 +109,18 @@ def initialize(parent = nil, name = nil)
|
|
|
|
|
self, SLOT( 'accept()' )
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
cancelPushButton = Qt::PushButton.new( self, "cancel" )
|
|
|
|
|
cancelPushButton = TQt::PushButton.new( self, "cancel" )
|
|
|
|
|
buttonsBox.addWidget( cancelPushButton )
|
|
|
|
|
cancelPushButton.setText( "Cancel" )
|
|
|
|
|
cancelPushButton.setAccel( Qt::KeySequence.new(Key_Escape) )
|
|
|
|
|
cancelPushButton.setAccel( TQt::KeySequence.new(Key_Escape) )
|
|
|
|
|
|
|
|
|
|
connect( cancelPushButton, SIGNAL( 'clicked()' ),
|
|
|
|
|
self, SLOT( 'reject()' )
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/config" )
|
|
|
|
|
if file.open( Qt::IO_ReadOnly )
|
|
|
|
|
ts = Qt::TextStream.new( file )
|
|
|
|
|
file = TQt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/config" )
|
|
|
|
|
if file.open( TQt::IO_ReadOnly )
|
|
|
|
|
ts = TQt::TextStream.new( file )
|
|
|
|
|
content = ''
|
|
|
|
|
ts >> content
|
|
|
|
|
if content == 'Very_low'
|
|
|
|
@ -137,9 +137,9 @@ def initialize(parent = nil, name = nil)
|
|
|
|
|
file.close()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/profiles" )
|
|
|
|
|
# if file.open( Qt::IO_ReadOnly )
|
|
|
|
|
# ts = Qt::TextStream.new( file )
|
|
|
|
|
# file = TQt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/profiles" )
|
|
|
|
|
# if file.open( TQt::IO_ReadOnly )
|
|
|
|
|
# ts = TQt::TextStream.new( file )
|
|
|
|
|
# while !ts.eof()
|
|
|
|
|
# content = ''
|
|
|
|
|
# ts >> content
|
|
|
|
@ -153,9 +153,9 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def accept()
|
|
|
|
|
file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/config" )
|
|
|
|
|
if file.open( Qt::IO_WriteOnly )
|
|
|
|
|
ts = Qt::TextStream.new( file )
|
|
|
|
|
file = TQt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/config" )
|
|
|
|
|
if file.open( TQt::IO_WriteOnly )
|
|
|
|
|
ts = TQt::TextStream.new( file )
|
|
|
|
|
if @cTranscodeProfile.currentText() == 'Very low'
|
|
|
|
|
content = 'Very_low'
|
|
|
|
|
elsif @cTranscodeProfile.currentText() == 'Low'
|
|
|
|
@ -201,7 +201,7 @@ loop do
|
|
|
|
|
|
|
|
|
|
case command
|
|
|
|
|
when "configure"
|
|
|
|
|
app = Qt::Application.new(ARGV)
|
|
|
|
|
app = TQt::Application.new(ARGV)
|
|
|
|
|
widget = MainWidget.new
|
|
|
|
|
app.setMainWidget(widget)
|
|
|
|
|
widget.show()
|
|
|
|
@ -215,9 +215,9 @@ loop do
|
|
|
|
|
filetype = args[2]
|
|
|
|
|
profile = ''
|
|
|
|
|
|
|
|
|
|
file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/formats" )
|
|
|
|
|
if file.open( Qt::IO_ReadOnly )
|
|
|
|
|
ts = Qt::TextStream.new( file )
|
|
|
|
|
file = TQt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/formats" )
|
|
|
|
|
if file.open( TQt::IO_ReadOnly )
|
|
|
|
|
ts = TQt::TextStream.new( file )
|
|
|
|
|
while !ts.eof()
|
|
|
|
|
mode = ''
|
|
|
|
|
formats = ''
|
|
|
|
@ -231,9 +231,9 @@ loop do
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if profile == ''
|
|
|
|
|
file = Qt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/config" )
|
|
|
|
|
if file.open( Qt::IO_ReadOnly )
|
|
|
|
|
ts = Qt::TextStream.new( file )
|
|
|
|
|
file = TQt::File.new( File.dirname( File.expand_path( __FILE__ ) ) + "/config" )
|
|
|
|
|
if file.open( TQt::IO_ReadOnly )
|
|
|
|
|
ts = TQt::TextStream.new( file )
|
|
|
|
|
content = ''
|
|
|
|
|
ts >> content
|
|
|
|
|
if content == 'Very_low'
|
|
|
|
|