diff options
Diffstat (limited to 'src/settingsz3950.cpp')
-rw-r--r-- | src/settingsz3950.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/settingsz3950.cpp b/src/settingsz3950.cpp index d2c3858..57784b9 100644 --- a/src/settingsz3950.cpp +++ b/src/settingsz3950.cpp @@ -23,12 +23,12 @@ #ifdef HAVE_YAZ -#include <qlayout.h> -#include <qtimer.h> -#include <qheader.h> -#include <qlabel.h> -#include <qspinbox.h> -#include <qregexp.h> +#include <ntqlayout.h> +#include <ntqtimer.h> +#include <ntqheader.h> +#include <ntqlabel.h> +#include <ntqspinbox.h> +#include <ntqregexp.h> #include <klistview.h> #include <kpushbutton.h> @@ -44,13 +44,13 @@ namespace KBibTeX { - ServerListViewItem::ServerListViewItem( KListView *list, const QString &_id, Settings::Z3950Server& _server, bool _newItem ) + ServerListViewItem::ServerListViewItem( KListView *list, const TQString &_id, Settings::Z3950Server& _server, bool _newItem ) : KListViewItem( list, _server.name, _server.database ), server( _server ), id( _id ), newItem( _newItem ) { // nothing } - ServerListViewItem::ServerListViewItem( KListViewItem *item, const QString &_id, Settings::Z3950Server& _server, bool _newItem ) + ServerListViewItem::ServerListViewItem( KListViewItem *item, const TQString &_id, Settings::Z3950Server& _server, bool _newItem ) : KListViewItem( item, _server.name, _server.database ), server( _server ), id( _id ), newItem( _newItem ) { // nothing @@ -62,52 +62,52 @@ namespace KBibTeX setText( 1, server.database ); } - SettingsZ3950Edit::SettingsZ3950Edit( QString &id, Settings::Z3950Server& _server, QWidget *parent, const char *name ) - : QWidget( parent, name ), m_id( id ), m_server( _server ), m_lineEditId( NULL ) + SettingsZ3950Edit::SettingsZ3950Edit( TQString &id, Settings::Z3950Server& _server, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_id( id ), m_server( _server ), m_lineEditId( NULL ) { - QGridLayout *layout = new QGridLayout( this, 10, 2 , 0, KDialog::spacingHint() ); - QLabel *label = NULL; + TQGridLayout *layout = new TQGridLayout( this, 10, 2 , 0, KDialog::spacingHint() ); + TQLabel *label = NULL; - label = new QLabel( i18n( "Name:" ), this ); + label = new TQLabel( i18n( "Name:" ), this ); layout->addWidget( label, 1, 0 ); m_lineEditName = new KLineEdit( m_server.name, this ); layout->addWidget( m_lineEditName, 1, 1 ); label->setBuddy( m_lineEditName ); - label = new QLabel( i18n( "Database:" ), this ); + label = new TQLabel( i18n( "Database:" ), this ); layout->addWidget( label, 2, 0 ); m_lineEditDatabase = new KLineEdit( m_server.database, this ); layout->addWidget( m_lineEditDatabase, 2, 1 ); label->setBuddy( m_lineEditDatabase ); - label = new QLabel( i18n( "Host:" ), this ); + label = new TQLabel( i18n( "Host:" ), this ); layout->addWidget( label, 3, 0 ); m_lineEditHost = new KLineEdit( m_server.host, this ); layout->addWidget( m_lineEditHost, 3, 1 ); label->setBuddy( m_lineEditHost ); - label = new QLabel( i18n( "Port:" ), this ); + label = new TQLabel( i18n( "Port:" ), this ); layout->addWidget( label, 4, 0 ); - m_spinBoxPort = new QSpinBox( this ); + m_spinBoxPort = new TQSpinBox( this ); m_spinBoxPort->setMinValue( 1 ); m_spinBoxPort->setMaxValue( 65535 ); m_spinBoxPort->setValue( m_server.port ); layout->addWidget( m_spinBoxPort, 4, 1 ); label->setBuddy( m_spinBoxPort ); - label = new QLabel( i18n( "User:" ), this ); + label = new TQLabel( i18n( "User:" ), this ); layout->addWidget( label, 5, 0 ); m_lineEditUser = new KLineEdit( m_server.user, this ); layout->addWidget( m_lineEditUser, 5, 1 ); label->setBuddy( m_lineEditUser ); - label = new QLabel( i18n( "Password:" ), this ); + label = new TQLabel( i18n( "Password:" ), this ); layout->addWidget( label, 6, 0 ); m_lineEditPassword = new KLineEdit( m_server.password, this ); layout->addWidget( m_lineEditPassword, 6, 1 ); label->setBuddy( m_lineEditPassword ); - label = new QLabel( i18n( "Syntax:" ), this ); + label = new TQLabel( i18n( "Syntax:" ), this ); layout->addWidget( label, 7, 0 ); m_comboBoxSyntax = new KComboBox( true, this ); layout->addWidget( m_comboBoxSyntax, 7, 1 ); @@ -119,14 +119,14 @@ namespace KBibTeX m_comboBoxSyntax->insertItem( "usmarc" ); m_comboBoxSyntax->setCurrentText( m_server.syntax ); - label = new QLabel( i18n( "Locale:" ), this ); + label = new TQLabel( i18n( "Locale:" ), this ); layout->addWidget( label, 8, 0 ); m_comboBoxLocale = new KComboBox( true, this ); m_comboBoxLocale->setCurrentText( m_server.locale ); layout->addWidget( m_comboBoxLocale, 8, 1 ); label->setBuddy( m_comboBoxLocale ); - label = new QLabel( i18n( "Charset:" ), this ); + label = new TQLabel( i18n( "Charset:" ), this ); layout->addWidget( label, 9, 0 ); m_comboBoxCharset = new KComboBox( true, this ); layout->addWidget( m_comboBoxCharset, 9, 1 ); @@ -144,7 +144,7 @@ namespace KBibTeX // nothing } - int SettingsZ3950Edit::execute( QWidget *parent, QString &id, Settings::Z3950Server &server ) + int SettingsZ3950Edit::execute( TQWidget *parent, TQString &id, Settings::Z3950Server &server ) { KDialogBase *dlg = new KDialogBase( parent, "SettingsZ3950Edit", true, i18n( "Edit Z39.50 Server" ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, false ); SettingsZ3950Edit *edit = new SettingsZ3950Edit( id, server, dlg, "SettingsZ3950Edit" ); @@ -169,13 +169,13 @@ namespace KBibTeX if ( m_id.isEmpty() ) { - m_id = QString( m_server.name ).lower().replace( QRegExp( "[^a-z0-9]" ), "" ); - qDebug( "Setting id to %s", m_id.latin1() ); + m_id = TQString( m_server.name ).lower().replace( TQRegExp( "[^a-z0-9]" ), "" ); + tqDebug( "Setting id to %s", m_id.latin1() ); } } - SettingsZ3950::SettingsZ3950( QWidget *parent, const char *name ) - : QWidget( parent, name ) + SettingsZ3950::SettingsZ3950( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { setupGUI(); } @@ -190,7 +190,7 @@ namespace KBibTeX Settings *settings = Settings::self(); settings->z3950_ServerList.clear(); - for ( QListViewItemIterator it( m_listServers ); it.current(); ++it ) + for ( TQListViewItemIterator it( m_listServers ); it.current(); ++it ) { ServerListViewItem *item = dynamic_cast<ServerListViewItem*>( *it ); settings->z3950_ServerList[item->id] = item->server; @@ -202,7 +202,7 @@ namespace KBibTeX Settings *settings = Settings::self(); m_listServers->clear(); - for ( QMap<QString, Settings::Z3950Server>::Iterator it = settings->z3950_ServerList.begin(); it != settings-> z3950_ServerList.end(); ++it ) + for ( TQMap<TQString, Settings::Z3950Server>::Iterator it = settings->z3950_ServerList.begin(); it != settings-> z3950_ServerList.end(); ++it ) { ServerListViewItem *item = new ServerListViewItem( m_listServers, it.key(), it.data(), false ); item->setPixmap( 0, SmallIcon( "server" ) ); @@ -218,7 +218,7 @@ namespace KBibTeX ServerListViewItem * item = new ServerListViewItem( m_listServers, "", server, true ); item->setPixmap( 0, SmallIcon( "server" ) ); m_listServers->setSelected( item, TRUE ); - QTimer::singleShot( 100, this, SLOT( slotEditServer() ) ); + TQTimer::singleShot( 100, this, SLOT( slotEditServer() ) ); } void SettingsZ3950::slotEditServer() @@ -226,7 +226,7 @@ namespace KBibTeX ServerListViewItem * item = static_cast<ServerListViewItem*>( m_listServers->selectedItem() ); if ( item != NULL ) { - if ( SettingsZ3950Edit::execute( this, item->id, item->server ) == QDialog::Accepted ) + if ( SettingsZ3950Edit::execute( this, item->id, item->server ) == TQDialog::Accepted ) { item->refresh(); emit configChanged(); @@ -255,12 +255,12 @@ namespace KBibTeX Settings::Z3950Server server = item->server; item->server = itemAbove->server; itemAbove->server = server; - QString id = item->id; + TQString id = item->id; item->id = itemAbove->id; itemAbove->id = id; for ( int i = 0; i < 2; ++i ) { - QString swap = item->text( i ); + TQString swap = item->text( i ); item->setText( i, itemAbove->text( i ) ); itemAbove->setText( i, swap ); } @@ -278,12 +278,12 @@ namespace KBibTeX Settings::Z3950Server server = item->server; item->server = itemBelow->server; itemBelow->server = server; - QString id = item->id; + TQString id = item->id; item->id = itemBelow->id; itemBelow->id = id; for ( int i = 0; i < 2; ++i ) { - QString swap = item->text( i ); + TQString swap = item->text( i ); item->setText( i, itemBelow->text( i ) ); itemBelow->setText( i, swap ); } @@ -305,7 +305,7 @@ namespace KBibTeX void SettingsZ3950::updateGUI() { - QListViewItem *item = m_listServers->selectedItem(); + TQListViewItem *item = m_listServers->selectedItem(); bool selected = item != NULL; m_buttonEditServer->setEnabled( selected ); m_buttonDeleteServer->setEnabled( selected ); @@ -315,7 +315,7 @@ namespace KBibTeX void SettingsZ3950::setupGUI() { - QGridLayout * gridLayout = new QGridLayout( this, 7, 2, 0, KDialog::spacingHint(), "gridLayout" ); + TQGridLayout * gridLayout = new TQGridLayout( this, 7, 2, 0, KDialog::spacingHint(), "gridLayout" ); gridLayout->setRowStretch( 5, 1 ); gridLayout->setColStretch( 0, 1 ); @@ -328,32 +328,32 @@ namespace KBibTeX m_listServers->setAllColumnsShowFocus( true ); gridLayout->addMultiCellWidget( m_listServers, 0, 7, 0, 0 ); connect( m_listServers, SIGNAL( selectionChanged() ), this, SLOT( updateGUI() ) ); - connect( m_listServers, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( updateGUI() ) ); - connect( m_listServers, SIGNAL( doubleClicked( QListViewItem*, const QPoint &, int ) ), this, SLOT( slotEditServer() ) ); + connect( m_listServers, SIGNAL( currentChanged( TQListViewItem * ) ), this, SLOT( updateGUI() ) ); + connect( m_listServers, SIGNAL( doubleClicked( TQListViewItem*, const TQPoint &, int ) ), this, SLOT( slotEditServer() ) ); m_buttonNewServer = new KPushButton( i18n( "z3950 server", "New" ), this ); - m_buttonNewServer->setIconSet( QIconSet( SmallIcon( "add" ) ) ); + m_buttonNewServer->setIconSet( TQIconSet( SmallIcon( "add" ) ) ); gridLayout->addWidget( m_buttonNewServer, 0, 1 ); connect( m_buttonNewServer, SIGNAL( clicked() ), this, SLOT( slotNewServer() ) ); m_buttonEditServer = new KPushButton( i18n( "z3950 server", "Edit" ), this ); - m_buttonEditServer->setIconSet( QIconSet( SmallIcon( "edit" ) ) ); + m_buttonEditServer->setIconSet( TQIconSet( SmallIcon( "edit" ) ) ); gridLayout->addWidget( m_buttonEditServer, 1, 1 ); connect( m_buttonEditServer, SIGNAL( clicked() ), this, SLOT( slotEditServer() ) ); m_buttonDeleteServer = new KPushButton( i18n( "z3950 server", "Delete" ), this ); - m_buttonDeleteServer->setIconSet( QIconSet( SmallIcon( "editdelete" ) ) ); + m_buttonDeleteServer->setIconSet( TQIconSet( SmallIcon( "editdelete" ) ) ); gridLayout->addWidget( m_buttonDeleteServer, 2, 1 ); connect( m_buttonDeleteServer, SIGNAL( clicked() ), this, SLOT( slotDeleteServer() ) ); m_buttonMoveUpServer = new KPushButton( i18n( "z3950 server", "Up" ), this ); - m_buttonMoveUpServer->setIconSet( QIconSet( SmallIcon( "up" ) ) ); + m_buttonMoveUpServer->setIconSet( TQIconSet( SmallIcon( "up" ) ) ); gridLayout->addWidget( m_buttonMoveUpServer, 3, 1 ); connect( m_buttonMoveUpServer, SIGNAL( clicked() ), this, SLOT( slotMoveUpServer() ) ); m_buttonMoveDownServer = new KPushButton( i18n( "z3950 server", "Down" ), this ); - m_buttonMoveDownServer->setIconSet( QIconSet( SmallIcon( "down" ) ) ); + m_buttonMoveDownServer->setIconSet( TQIconSet( SmallIcon( "down" ) ) ); gridLayout->addWidget( m_buttonMoveDownServer, 4, 1 ); connect( m_buttonMoveDownServer, SIGNAL( clicked() ), this, SLOT( slotMoveDownServer() ) ); m_buttonResetToDefault = new KPushButton( i18n( "z3950 server", "Reset" ), this ); - m_buttonResetToDefault->setIconSet( QIconSet( SmallIcon( "reload" ) ) ); + m_buttonResetToDefault->setIconSet( TQIconSet( SmallIcon( "reload" ) ) ); gridLayout->addWidget( m_buttonResetToDefault, 6, 1 ); connect( m_buttonResetToDefault, SIGNAL( clicked() ), this, SLOT( slotResetToDefault() ) ); } |