summaryrefslogtreecommitdiffstats
path: root/src/settingsuserdefinedinput.cpp
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2013-06-29 12:56:53 +0200
committerSlávek Banko <[email protected]>2013-07-04 03:11:35 +0200
commit5f5e7c5455d52826b0bd50f64fcffb7695ce970d (patch)
treec8ee8792d3fb139365abbf70c2255f1e69d2aa34 /src/settingsuserdefinedinput.cpp
parent251c9a439759c830d34c70683d0fc9454d703010 (diff)
downloadkbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.tar.gz
kbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.zip
Initial TQt conversion
Diffstat (limited to 'src/settingsuserdefinedinput.cpp')
-rw-r--r--src/settingsuserdefinedinput.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/settingsuserdefinedinput.cpp b/src/settingsuserdefinedinput.cpp
index dc903bc..3085814 100644
--- a/src/settingsuserdefinedinput.cpp
+++ b/src/settingsuserdefinedinput.cpp
@@ -17,10 +17,10 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#include <qlayout.h>
-#include <qheader.h>
-#include <qlabel.h>
-#include <qtooltip.h>
+#include <ntqlayout.h>
+#include <ntqheader.h>
+#include <ntqlabel.h>
+#include <ntqtooltip.h>
#include <kdialog.h>
#include <kdialogbase.h>
@@ -40,7 +40,7 @@
namespace KBibTeX
{
- SettingsUserDefinedInput::SettingsUserDefinedInput( QWidget *parent, const char *name ) : QWidget( parent, name )
+ SettingsUserDefinedInput::SettingsUserDefinedInput( TQWidget *parent, const char *name ) : TQWidget( parent, name )
{
setupGUI();
}
@@ -54,7 +54,7 @@ namespace KBibTeX
{
Settings *settings = Settings::self( NULL );
settings->userDefinedInputFields.clear();
- for ( QListViewItemIterator it( m_listFields ); it.current(); ++it )
+ for ( TQListViewItemIterator it( m_listFields ); it.current(); ++it )
{
Settings::UserDefinedInputFields *udif = new Settings::UserDefinedInputFields();
udif->name = it.current()->text( 0 );
@@ -69,7 +69,7 @@ namespace KBibTeX
m_listFields->clear();
Settings *settings = Settings::self( NULL );
KListViewItem *prev = NULL;
- for ( QValueList<Settings::UserDefinedInputFields*>::iterator it = settings->userDefinedInputFields.begin(); it != settings->userDefinedInputFields.end(); ++it )
+ for ( TQValueList<Settings::UserDefinedInputFields*>::iterator it = settings->userDefinedInputFields.begin(); it != settings->userDefinedInputFields.end(); ++it )
{
prev = new KListViewItem( m_listFields, prev, ( *it )->name, ( *it )->label, ( *it )->inputType == FieldLineEdit::itMultiLine ? i18n( "Multiple lines" ) : i18n( "Single line" ) );
}
@@ -84,7 +84,7 @@ namespace KBibTeX
void SettingsUserDefinedInput::slotEditField()
{
- QListViewItem * item = m_listFields->selectedItem();
+ TQListViewItem * item = m_listFields->selectedItem();
if ( item != NULL )
{
fieldDialog( item );
@@ -95,7 +95,7 @@ namespace KBibTeX
void SettingsUserDefinedInput::slotDeleteField()
{
- QListViewItem * item = m_listFields->selectedItem();
+ TQListViewItem * item = m_listFields->selectedItem();
if ( item != NULL )
{
m_listFields->removeItem( item );
@@ -106,13 +106,13 @@ namespace KBibTeX
void SettingsUserDefinedInput::slotMoveUpField()
{
- QListViewItem *item = m_listFields->selectedItem();
+ TQListViewItem *item = m_listFields->selectedItem();
if ( item != NULL && item -> itemAbove() != NULL )
{
- QListViewItem *itemAbove = item->itemAbove();
+ TQListViewItem *itemAbove = item->itemAbove();
for ( int i = 0; i < 3; ++i )
{
- QString text = item->text( i );
+ TQString text = item->text( i );
item->setText( i, itemAbove->text( i ) );
itemAbove->setText( i, text );
}
@@ -124,13 +124,13 @@ namespace KBibTeX
void SettingsUserDefinedInput::slotMoveDownField()
{
- QListViewItem *item = m_listFields->selectedItem();
+ TQListViewItem *item = m_listFields->selectedItem();
if ( item != NULL && item -> itemBelow() != NULL )
{
- QListViewItem *itemBelow = item->itemBelow();
+ TQListViewItem *itemBelow = item->itemBelow();
for ( int i = 0; i < 3; ++i )
{
- QString text = item->text( i );
+ TQString text = item->text( i );
item->setText( i, itemBelow->text( i ) );
itemBelow->setText( i, text );
}
@@ -142,7 +142,7 @@ namespace KBibTeX
void SettingsUserDefinedInput::updateGUI()
{
- QListViewItem *item = m_listFields->selectedItem();
+ TQListViewItem *item = m_listFields->selectedItem();
bool selected = item != NULL;
m_buttonEditField->setEnabled( selected );
m_buttonDeleteField->setEnabled( selected );
@@ -159,7 +159,7 @@ namespace KBibTeX
void SettingsUserDefinedInput::setupGUI()
{
- QGridLayout * gridLayout = new QGridLayout( this, 6, 2, 0, KDialog::spacingHint(), "gridLayout" );
+ TQGridLayout * gridLayout = new TQGridLayout( this, 6, 2, 0, KDialog::spacingHint(), "gridLayout" );
gridLayout->setRowStretch( 5, 1 );
gridLayout->setColStretch( 0, 1 );
@@ -178,20 +178,20 @@ namespace KBibTeX
gridLayout->addMultiCellWidget( m_listFields, 0, 5, 0, 0 );
m_buttonNewField = new KPushButton( i18n( "user-defined input", "New" ), this );
- m_buttonNewField->setIconSet( QIconSet( SmallIcon( "add" ) ) );
+ m_buttonNewField->setIconSet( TQIconSet( SmallIcon( "add" ) ) );
gridLayout->addWidget( m_buttonNewField, 0, 1 );
m_buttonEditField = new KPushButton( i18n( "user-defined input", "Edit" ), this );
- m_buttonEditField->setIconSet( QIconSet( SmallIcon( "edit" ) ) );
+ m_buttonEditField->setIconSet( TQIconSet( SmallIcon( "edit" ) ) );
gridLayout->addWidget( m_buttonEditField, 1, 1 );
m_buttonDeleteField = new KPushButton( i18n( "user-defined input", "Delete" ), this );
- m_buttonDeleteField->setIconSet( QIconSet( SmallIcon( "editdelete" ) ) );
+ m_buttonDeleteField->setIconSet( TQIconSet( SmallIcon( "editdelete" ) ) );
gridLayout->addWidget( m_buttonDeleteField, 2, 1 );
m_buttonMoveUpField = new KPushButton( i18n( "user-defined input", "Up" ), this );
- m_buttonMoveUpField->setIconSet( QIconSet( SmallIcon( "up" ) ) );
+ m_buttonMoveUpField->setIconSet( TQIconSet( SmallIcon( "up" ) ) );
gridLayout->addWidget( m_buttonMoveUpField, 3, 1 );
connect( m_buttonMoveUpField, SIGNAL( clicked() ), this, SLOT( slotMoveUpField() ) );
m_buttonMoveDownField = new KPushButton( i18n( "user-defined input", "Down" ), this );
- m_buttonMoveDownField->setIconSet( QIconSet( SmallIcon( "down" ) ) );
+ m_buttonMoveDownField->setIconSet( TQIconSet( SmallIcon( "down" ) ) );
gridLayout->addWidget( m_buttonMoveDownField, 4, 1 );
connect( m_buttonMoveDownField, SIGNAL( clicked() ), this, SLOT( slotMoveDownField() ) );
@@ -199,29 +199,29 @@ namespace KBibTeX
connect( m_buttonEditField, SIGNAL( clicked() ), this, SLOT( slotEditField() ) );
connect( m_buttonDeleteField, SIGNAL( clicked() ), this, SLOT( slotDeleteField() ) );
connect( m_listFields, SIGNAL( selectionChanged() ), this, SLOT( updateGUI() ) );
- connect( m_listFields, SIGNAL( doubleClicked( QListViewItem*, const QPoint &, int ) ), this, SLOT( slotEditField() ) );
- connect( m_listFields, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( updateGUI() ) );
+ connect( m_listFields, SIGNAL( doubleClicked( TQListViewItem*, const TQPoint &, int ) ), this, SLOT( slotEditField() ) );
+ connect( m_listFields, SIGNAL( currentChanged( TQListViewItem * ) ), this, SLOT( updateGUI() ) );
updateGUI();
}
- void SettingsUserDefinedInput::fieldDialog( QListViewItem * item )
+ void SettingsUserDefinedInput::fieldDialog( TQListViewItem * item )
{
fieldDlg = new KDialogBase( this, "fieldDialog", TRUE, item == NULL ? i18n( "New Field" ) : i18n( "Edit Field" ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, TRUE );
- QWidget *container = new QWidget( fieldDlg, "container" );
- QGridLayout *layout = new QGridLayout( container, 3, 2, 0, KDialog::spacingHint() );
- QLabel *label = new QLabel( i18n( "Name:" ), container );
+ TQWidget *container = new TQWidget( fieldDlg, "container" );
+ TQGridLayout *layout = new TQGridLayout( container, 3, 2, 0, KDialog::spacingHint() );
+ TQLabel *label = new TQLabel( i18n( "Name:" ), container );
layout->addWidget( label, 0, 0 );
m_lineEditName = new KLineEdit( container );
label->setBuddy( m_lineEditName );
layout->addWidget( m_lineEditName, 0, 1 );
- label = new QLabel( i18n( "Label:" ), container );
+ label = new TQLabel( i18n( "Label:" ), container );
layout->addWidget( label, 1, 0 );
m_lineEditLabel = new KLineEdit( container );
layout->addWidget( m_lineEditLabel, 1, 1 );
label->setBuddy( m_lineEditLabel );
m_lineEditLabel->setMinimumWidth( 384 );
- label = new QLabel( i18n( "Input Type:" ), container );
+ label = new TQLabel( i18n( "Input Type:" ), container );
layout->addWidget( label, 2, 0 );
KComboBox *comboBoxInputType = new KComboBox( FALSE, container );
layout->addWidget( comboBoxInputType, 2, 1 );
@@ -241,9 +241,9 @@ namespace KBibTeX
else
fieldDlg->enableButton( KDialogBase::Ok, false );
- connect( m_lineEditName, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateDialogGUI() ) );
- connect( m_lineEditLabel, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateDialogGUI() ) );
- if ( fieldDlg->exec() == QDialog::Accepted )
+ connect( m_lineEditName, SIGNAL( textChanged( const TQString & ) ), this, SLOT( updateDialogGUI() ) );
+ connect( m_lineEditLabel, SIGNAL( textChanged( const TQString & ) ), this, SLOT( updateDialogGUI() ) );
+ if ( fieldDlg->exec() == TQDialog::Accepted )
{
if ( item == NULL )
{