summaryrefslogtreecommitdiffstats
path: root/src/app/xineConfig.cpp
diff options
context:
space:
mode:
authorgregory guy <[email protected]>2020-06-13 16:09:24 +0200
committergregory guy <[email protected]>2020-06-13 16:09:24 +0200
commit2c9bc9b806f533df7b8f5349467d0f4be95314a4 (patch)
tree15f82ae94dd430374f3d939958912c4fb2855326 /src/app/xineConfig.cpp
parent38eaf7209a322a622e1b898eaa5477568ca9c6b6 (diff)
downloadcodeine-2c9bc9b806f533df7b8f5349467d0f4be95314a4.tar.gz
codeine-2c9bc9b806f533df7b8f5349467d0f4be95314a4.zip
Conversion qt3 -> tqt3
Signed-off-by: gregory guy <[email protected]>
Diffstat (limited to 'src/app/xineConfig.cpp')
-rw-r--r--src/app/xineConfig.cpp144
1 files changed, 72 insertions, 72 deletions
diff --git a/src/app/xineConfig.cpp b/src/app/xineConfig.cpp
index 70ca11a..abeca50 100644
--- a/src/app/xineConfig.cpp
+++ b/src/app/xineConfig.cpp
@@ -8,18 +8,18 @@
#include <klineedit.h>
#include <kseparator.h>
#include <kstdguiitem.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qscrollview.h>
-#include <qspinbox.h>
-#include <qtabwidget.h>
-#include <qtooltip.h>
-#include <qvbox.h>
+#include <ntqcheckbox.h>
+#include <ntqlabel.h>
+#include <ntqlayout.h>
+#include <ntqscrollview.h>
+#include <ntqspinbox.h>
+#include <ntqtabwidget.h>
+#include <ntqtooltip.h>
+#include <ntqvbox.h>
#include <xine.h>
#include "xineConfig.h"
-QString i18n(const char *text);
+TQString i18n(const char *text);
KDialogBase *XineConfigDialog::s_instance = 0;
@@ -28,33 +28,33 @@ KDialogBase *XineConfigDialog::s_instance = 0;
namespace Codeine
{
void
- showXineConfigurationDialog( QWidget *parent, xine_t *xine )
+ showXineConfigurationDialog( TQWidget *parent, xine_t *xine )
{
XineConfigDialog d( xine, parent );
- if( d.exec() == QDialog::Accepted )
+ if( d.exec() == TQDialog::Accepted )
d.saveSettings();
}
}
-class TabWidget : public QTabWidget
+class TabWidget : public TQTabWidget
{
public:
- TabWidget( QWidget *parent ) : QTabWidget( parent ) {}
+ TabWidget( TQWidget *parent ) : TQTabWidget( parent ) {}
- virtual QSize sizeHint() const
+ virtual TQSize sizeHint() const
{
- // Qt gives a stupid default sizeHint for this widget
- return QSize(
- reinterpret_cast<QWidget*>(tabBar())->sizeHint().width() + 5,
- QTabWidget::sizeHint().height() );
+ // TQt gives a stupid default sizeHint for this widget
+ return TQSize(
+ reinterpret_cast<TQWidget*>(tabBar())->sizeHint().width() + 5,
+ TQTabWidget::sizeHint().height() );
}
};
///@class XineConfigDialog
-XineConfigDialog::XineConfigDialog( xine_t *xine, QWidget *parent )
+XineConfigDialog::XineConfigDialog( xine_t *xine, TQWidget *parent )
: KDialogBase( parent, "xine_config_dialog",
true, //modal
i18n("Configure xine"), User1 | Stretch | Ok | Cancel,
@@ -69,22 +69,22 @@ XineConfigDialog::XineConfigDialog( xine_t *xine, QWidget *parent )
const int METRIC = fontMetrics().width( 'x' );
const int METRIC_3B2 = (3*METRIC)/2;
- QVBox *box = new QVBox( this );
+ TQVBox *box = new TQVBox( this );
box->setSpacing( METRIC );
setMainWidget( box );
{
- QHBox *hbox = new QHBox( box );
+ TQHBox *hbox = new TQHBox( box );
hbox->setSpacing( METRIC_3B2 );
hbox->setMargin( METRIC_3B2 );
- QPixmap info = kapp->iconLoader()->loadIcon( "messagebox_info", KIcon::NoGroup, KIcon::SizeMedium, KIcon::DefaultState, 0, true );
- QLabel *label = new QLabel( hbox );
+ TQPixmap info = kapp->iconLoader()->loadIcon( "messagebox_info", KIcon::NoGroup, KIcon::SizeMedium, KIcon::DefaultState, 0, true );
+ TQLabel *label = new TQLabel( hbox );
label->setPixmap( info );
- label->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
- label = new QLabel( i18n(
+ label->setSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Maximum );
+ label = new TQLabel( i18n(
"xine's defaults are usually sensible and should not require modification. "
"However, full configurability is provided for your pleasure ;-)." ), hbox );
- label->setAlignment( QLabel::WordBreak | QLabel::AlignVCenter );
+ label->setAlignment( TQLabel::WordBreak | TQLabel::AlignVCenter );
}
//FIXME after many hours I have discovered that this
@@ -104,16 +104,16 @@ XineConfigDialog::XineConfigDialog( xine_t *xine, QWidget *parent )
};
- QGridLayout *grid = 0;
- QString currentPage;
- QScrollView *view = 0;
+ TQGridLayout *grid = 0;
+ TQString currentPage;
+ TQScrollView *view = 0;
parent = 0;
for( XineConfigEntryIterator it( m_xine ); *it; ++it )
{
- const QString pageName = QString::fromUtf8( (*it)->key ).section( '.', 0, 0 );
+ const TQString pageName = TQString::fromUtf8( (*it)->key ).section( '.', 0, 0 );
- if( (QStringList() << "ui" << "effects" << "subtitles").contains( pageName ) )
+ if( (TQStringList() << "ui" << "effects" << "subtitles").contains( pageName ) )
continue;
if( pageName != currentPage ) {
@@ -121,21 +121,21 @@ XineConfigDialog::XineConfigDialog( xine_t *xine, QWidget *parent )
//NOTE won't be executed for last tab
view->viewport()->setMinimumWidth( grid->sizeHint().width() ); // seems necessary
- QString pageTitle = pageName;
+ TQString pageTitle = pageName;
pageTitle[0] = pageTitle[0].upper();
- tabs->addTab( view = new QScrollView, pageTitle );
- view->setResizePolicy( QScrollView::AutoOneFit );
- view->setHScrollBarMode( QScrollView::AlwaysOff );
- view->setFrameShape( QFrame::NoFrame );
- view->addChild( parent = new QWidget( view->viewport() ) );
+ tabs->addTab( view = new TQScrollView, pageTitle );
+ view->setResizePolicy( TQScrollView::AutoOneFit );
+ view->setHScrollBarMode( TQScrollView::AlwaysOff );
+ view->setFrameShape( TQFrame::NoFrame );
+ view->addChild( parent = new TQWidget( view->viewport() ) );
- QBoxLayout *layout = new QVBoxLayout( parent, /*margin*/METRIC_3B2, /*spacing*/0 );
+ TQBoxLayout *layout = new TQVBoxLayout( parent, /*margin*/METRIC_3B2, /*spacing*/0 );
- parent = new QFrame( parent );
- static_cast<QFrame*>(parent)->setFrameStyle( QFrame::Panel | QFrame::Raised );
- static_cast<QFrame*>(parent)->setLineWidth( 2 );
- grid = new QGridLayout( parent, /*rows*/0, /*cols*/2, /*margin*/20, /*spacing*/int(METRIC*2.5) );
+ parent = new TQFrame( parent );
+ static_cast<TQFrame*>(parent)->setFrameStyle( TQFrame::Panel | TQFrame::Raised );
+ static_cast<TQFrame*>(parent)->setLineWidth( 2 );
+ grid = new TQGridLayout( parent, /*rows*/0, /*cols*/2, /*margin*/20, /*spacing*/int(METRIC*2.5) );
grid->setColStretch( 0, 3 );
grid->setColStretch( 1, 2 );
@@ -169,7 +169,7 @@ XineConfigDialog::slotHelp()
void
XineConfigDialog::slotUser1()
{
- for( QPtrListIterator<XineConfigEntry> it( m_entrys ); *it != 0; ++it )
+ for( TQPtrListIterator<XineConfigEntry> it( m_entrys ); *it != 0; ++it )
(*it)->reset();
slotHelp();
@@ -178,14 +178,14 @@ XineConfigDialog::slotUser1()
bool
XineConfigDialog::isUnsavedSettings() const
{
- for( QPtrListIterator<XineConfigEntry> it( m_entrys ); *it != 0; ++it )
+ for( TQPtrListIterator<XineConfigEntry> it( m_entrys ); *it != 0; ++it )
if( (*it)->isChanged() )
return true;
return false;
}
-#include <qdir.h>
+#include <ntqdir.h>
void
XineConfigDialog::saveSettings()
{
@@ -193,56 +193,56 @@ XineConfigDialog::saveSettings()
if( entry->isChanged() )
entry->save( m_xine );
- xine_config_save( m_xine, QFile::encodeName( QDir::homeDirPath() + "/.xine/config" ) );
+ xine_config_save( m_xine, TQFile::encodeName( TQDir::homeDirPath() + "/.xine/config" ) );
}
///@class XineConfigEntry
-XineConfigEntry::XineConfigEntry( QWidget *parent, QGridLayout *grid, xine_cfg_entry_t *entry )
+XineConfigEntry::XineConfigEntry( TQWidget *parent, TQGridLayout *grid, xine_cfg_entry_t *entry )
: m_widget( 0 )
, m_key( entry->key )
, m_string( entry->str_value )
, m_number( entry->num_value )
{
- QWidget *&w = m_widget;
+ TQWidget *&w = m_widget;
const char *signal = 0;
const int row = grid->numRows();
- QString description_text = QString::fromUtf8( entry->description );
+ TQString description_text = TQString::fromUtf8( entry->description );
description_text[0] = description_text[0].upper();
switch( entry->type )
{
case XINE_CONFIG_TYPE_STRING: {
w = new KLineEdit( m_string, parent );
- signal = SIGNAL(textChanged( const QString& ));
+ signal = SIGNAL(textChanged( const TQString& ));
break;
}
case XINE_CONFIG_TYPE_ENUM: {
w = new KComboBox( parent );
for( int i = 0; entry->enum_values[i]; ++i )
- ((KComboBox*)w)->insertItem( QString::fromUtf8( entry->enum_values[i] ) );
+ ((KComboBox*)w)->insertItem( TQString::fromUtf8( entry->enum_values[i] ) );
((KComboBox*)w)->setCurrentItem( m_number );
signal = SIGNAL(activated( int ));
break;
}
case XINE_CONFIG_TYPE_RANGE:
case XINE_CONFIG_TYPE_NUM: {
- w = new QSpinBox(
- QMIN( m_number, entry->range_min ), // xine bug, sometimes the min and max ranges
- QMAX( m_number, entry->range_max ), // are both 0 even though this is bullshit
+ w = new TQSpinBox(
+ TQMIN( m_number, entry->range_min ), // xine bug, sometimes the min and max ranges
+ TQMAX( m_number, entry->range_max ), // are both 0 even though this is bullshit
1, parent );
- ((QSpinBox*)w)->setValue( m_number );
+ ((TQSpinBox*)w)->setValue( m_number );
signal = SIGNAL(valueChanged( int ));
break;
}
case XINE_CONFIG_TYPE_BOOL: {
- w = new QCheckBox( description_text, parent );
- ((QCheckBox*)w)->setChecked( m_number );
+ w = new TQCheckBox( description_text, parent );
+ ((TQCheckBox*)w)->setChecked( m_number );
connect( w, SIGNAL(toggled( bool )), XineConfigDialog::instance(), SLOT(slotHelp()) );
- QToolTip::add( w, "<qt>" + QString::fromUtf8( entry->help ) );
+ TQToolTip::add( w, "<qt>" + TQString::fromUtf8( entry->help ) );
grid->addMultiCellWidget( w, row, row, 0, 1 );
return; //no need for a description label
}
@@ -252,15 +252,15 @@ XineConfigEntry::XineConfigEntry( QWidget *parent, QGridLayout *grid, xine_cfg_e
connect( w, signal, XineConfigDialog::instance(), SLOT(slotHelp()) );
- QLabel *description = new QLabel( description_text + ':', parent );
- description->setAlignment( QLabel::WordBreak | QLabel::AlignVCenter );
+ TQLabel *description = new TQLabel( description_text + ':', parent );
+ description->setAlignment( TQLabel::WordBreak | TQLabel::AlignVCenter );
- const QString tip = "<qt>" + QString::fromUtf8( entry->help );
- QToolTip::add( w, tip );
- QToolTip::add( description, tip );
+ const TQString tip = "<qt>" + TQString::fromUtf8( entry->help );
+ TQToolTip::add( w, tip );
+ TQToolTip::add( description, tip );
-// grid->addWidget( description, row, 0, Qt::AlignVCenter );
- grid->addWidget( w, row, 1, Qt::AlignTop );
+// grid->addWidget( description, row, 0, TQt::AlignVCenter );
+ grid->addWidget( w, row, 1, TQt::AlignTop );
}
bool
@@ -271,8 +271,8 @@ XineConfigEntry::isChanged() const
switch( classType( m_widget->className() ) ) {
case LineEdit: return _(KLineEdit)->text().utf8() != m_string;
case ComboBox: return _(KComboBox)->currentItem() != m_number;
- case SpinBox: return _(QSpinBox)->value() != m_number;
- case CheckBox: return _(QCheckBox)->isChecked() != m_number;
+ case SpinBox: return _(TQSpinBox)->value() != m_number;
+ case CheckBox: return _(TQCheckBox)->isChecked() != m_number;
}
return false;
}
@@ -288,8 +288,8 @@ XineConfigEntry::reset()
switch( classType( m_widget->className() ) ) {
case LineEdit: _(KLineEdit)->setText( m_string ); break;
case ComboBox: _(KComboBox)->setCurrentItem( m_number ); break;
- case SpinBox: _(QSpinBox)->setValue( m_number ); break;
- case CheckBox: _(QCheckBox)->setChecked( (bool)m_number ); break;
+ case SpinBox: _(TQSpinBox)->setValue( m_number ); break;
+ case CheckBox: _(TQCheckBox)->setChecked( (bool)m_number ); break;
}
m_widget->blockSignals( false );
}
@@ -304,11 +304,11 @@ XineConfigEntry::save( xine_t *xine )
switch( classType( m_widget->className() ) ) {
case LineEdit: m_string = _(KLineEdit)->text().utf8(); break;
case ComboBox: m_number = _(KComboBox)->currentItem(); break;
- case SpinBox: m_number = _(QSpinBox)->value(); break;
- case CheckBox: m_number = _(QCheckBox)->isChecked(); break;
+ case SpinBox: m_number = _(TQSpinBox)->value(); break;
+ case CheckBox: m_number = _(TQCheckBox)->isChecked(); break;
}
- ent.str_value = qstrdup( m_string );
+ ent.str_value = tqstrdup( m_string );
ent.num_value = m_number;
debug() << "Saving setting: " << key() << endl;