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