summaryrefslogtreecommitdiffstats
path: root/src/sidebar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sidebar.cpp')
-rw-r--r--src/sidebar.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/sidebar.cpp b/src/sidebar.cpp
index 399cabf..e2202f0 100644
--- a/src/sidebar.cpp
+++ b/src/sidebar.cpp
@@ -17,13 +17,13 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#include <qlayout.h>
-#include <qcombobox.h>
-#include <qheader.h>
-#include <qapplication.h>
-#include <qtooltip.h>
-#include <qstring.h>
-#include <qtoolbutton.h>
+#include <ntqlayout.h>
+#include <ntqcombobox.h>
+#include <ntqheader.h>
+#include <ntqapplication.h>
+#include <ntqtooltip.h>
+#include <ntqstring.h>
+#include <ntqtoolbutton.h>
#include <kdebug.h>
#include <kpopupmenu.h>
@@ -44,8 +44,8 @@ namespace KBibTeX
BibTeX::EntryField::ftAuthor, BibTeX::EntryField::ftBookTitle, BibTeX::EntryField::ftJournal, BibTeX::EntryField::ftTitle, BibTeX::EntryField::ftYear, BibTeX::EntryField::ftKeywords
};
- SideBar::SideBar( bool isReadOnly, QWidget *parent, const char *name )
- : QWidget( parent, name ), m_bibtexFile( NULL ), m_isReadOnly( isReadOnly ), m_popupMenu( NULL )
+ SideBar::SideBar( bool isReadOnly, TQWidget *parent, const char *name )
+ : TQWidget( parent, name ), m_bibtexFile( NULL ), m_isReadOnly( isReadOnly ), m_popupMenu( NULL )
{
setupGUI();
}
@@ -70,7 +70,7 @@ namespace KBibTeX
if ( bibtexFile != NULL )
m_bibtexFile = bibtexFile;
- QApplication::setOverrideCursor( Qt::waitCursor );
+ TQApplication::setOverrideCursor( TQt::waitCursor );
setEnabled( FALSE );
BibTeX::EntryField::FieldType fieldType = m_buttonToggleShowAll->isOn() ? ( BibTeX::EntryField::FieldType )( m_listTypeList->currentItem() + ( int ) BibTeX::EntryField::ftAbstract ) : importantFields[ m_listTypeList->currentItem()];
@@ -78,50 +78,50 @@ namespace KBibTeX
m_listAvailableItems->clear();
if ( m_bibtexFile != NULL )
{
- QMap<QString, int> allValues = m_bibtexFile->getAllValuesAsStringListWithCount( fieldType );
- for ( QMap<QString, int>::ConstIterator it = allValues.constBegin(); it != allValues.constEnd();++it )
+ TQMap<TQString, int> allValues = m_bibtexFile->getAllValuesAsStringListWithCount( fieldType );
+ for ( TQMap<TQString, int>::ConstIterator it = allValues.constBegin(); it != allValues.constEnd();++it )
{
- QString text = it.key();
+ TQString text = it.key();
if ( !text.startsWith( "other" ) )
- new SideBarListViewItem( m_listAvailableItems, QString::number( it.data() ), text );
+ new SideBarListViewItem( m_listAvailableItems, TQString::number( it.data() ), text );
}
}
setEnabled( TRUE );
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
}
- void SideBar::resizeEvent( QResizeEvent *event )
+ void SideBar::resizeEvent( TQResizeEvent *event )
{
- QSize widgetSize = size();
+ TQSize widgetSize = size();
setEnabled( widgetSize.width() > 3 && widgetSize.height() > 3 );
- QWidget::resizeEvent( event );
+ TQWidget::resizeEvent( event );
}
void SideBar::setupGUI()
{
- QGridLayout * layout = new QGridLayout( this, 2, 3, 0, KDialog::spacingHint() );
+ TQGridLayout * layout = new TQGridLayout( this, 2, 3, 0, KDialog::spacingHint() );
layout->setColStretch( 0, 0 );
layout->setColStretch( 1, 10 );
layout->setColStretch( 2, 0 );
- m_buttonToggleShowAll = new QToolButton( this );
+ m_buttonToggleShowAll = new TQToolButton( this );
layout->addWidget( m_buttonToggleShowAll, 0, 0 );
- QIconSet showAllPixmap = KGlobal::iconLoader() ->loadIconSet( "taskbar", KIcon::Small );
+ TQIconSet showAllPixmap = KGlobal::iconLoader() ->loadIconSet( "taskbar", KIcon::Small );
m_buttonToggleShowAll->setIconSet( showAllPixmap );
m_buttonToggleShowAll->setToggleButton( TRUE );
- QToolTip::add( m_buttonToggleShowAll, i18n( "Toggle between showing all fields or only important fields" ) );
+ TQToolTip::add( m_buttonToggleShowAll, i18n( "Toggle between showing all fields or only important fields" ) );
- m_listTypeList = new QComboBox( FALSE, this );
+ m_listTypeList = new TQComboBox( FALSE, this );
layout->addWidget( m_listTypeList, 0, 1 );
- QToolTip::add( m_listTypeList, i18n( "Filter this sidebar for a given field" ) );
+ TQToolTip::add( m_listTypeList, i18n( "Filter this sidebar for a given field" ) );
- m_buttonToggleMultiSelect = new QToolButton( this );
+ m_buttonToggleMultiSelect = new TQToolButton( this );
layout->addWidget( m_buttonToggleMultiSelect, 0, 2 );
showAllPixmap = KGlobal::iconLoader() ->loadIconSet( "planner", KIcon::Small );
m_buttonToggleMultiSelect->setIconSet( showAllPixmap );
m_buttonToggleMultiSelect->setToggleButton( TRUE );
- QToolTip::add( m_buttonToggleMultiSelect, i18n( "Toggle between selecting only one item or multiple items (AND-connected in search)" ) );
+ TQToolTip::add( m_buttonToggleMultiSelect, i18n( "Toggle between selecting only one item or multiple items (AND-connected in search)" ) );
m_listAvailableItems = new KListView( this );
m_listAvailableItems->addColumn( i18n( "#" ) );
@@ -138,8 +138,8 @@ namespace KBibTeX
connect( m_listTypeList, SIGNAL( activated( int ) ), this, SLOT( refreshLists() ) );
connect( m_buttonToggleShowAll, SIGNAL( toggled( bool ) ), this, SLOT( toggleShowAll( bool ) ) );
connect( m_buttonToggleMultiSelect, SIGNAL( toggled( bool ) ), this, SLOT( toggleMultiSelect( bool ) ) );
- connect( m_listAvailableItems, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint&, int ) ), this, SLOT( showContextMenu( QListViewItem*, const QPoint& ) ) );
- connect( m_listAvailableItems, SIGNAL( itemRenamed( QListViewItem*, int, const QString& ) ), this, SLOT( endRenaming( QListViewItem*, int, const QString& ) ) );
+ connect( m_listAvailableItems, SIGNAL( contextMenuRequested( TQListViewItem*, const TQPoint&, int ) ), this, SLOT( showContextMenu( TQListViewItem*, const TQPoint& ) ) );
+ connect( m_listAvailableItems, SIGNAL( itemRenamed( TQListViewItem*, int, const TQString& ) ), this, SLOT( endRenaming( TQListViewItem*, int, const TQString& ) ) );
toggleShowAll( FALSE );
}
@@ -154,9 +154,9 @@ namespace KBibTeX
{
BibTeX::EntryField::FieldType fieldType = m_buttonToggleShowAll->isOn() ? ( BibTeX::EntryField::FieldType )( m_listTypeList->currentItem() + ( int ) BibTeX::EntryField::ftAbstract ) : importantFields[ m_listTypeList->currentItem()];
- QString text = "";
+ TQString text = "";
int countSelected = 0;
- for ( QListViewItemIterator it( m_listAvailableItems, QListViewItemIterator::Selected ); it.current(); ++it, ++countSelected )
+ for ( TQListViewItemIterator it( m_listAvailableItems, TQListViewItemIterator::Selected ); it.current(); ++it, ++countSelected )
{
if ( !text.isEmpty() ) text += " ";
text += it.current()->text( 1 );
@@ -190,12 +190,12 @@ namespace KBibTeX
void SideBar::toggleMultiSelect( bool multiSelect )
{
- m_listAvailableItems->setSelectionMode( multiSelect ? QListView::Extended : QListView::Single );
+ m_listAvailableItems->setSelectionMode( multiSelect ? TQListView::Extended : TQListView::Single );
m_listAvailableItems->clearSelection();
prepareSearch();
}
- void SideBar::showContextMenu( QListViewItem * item, const QPoint & pos )
+ void SideBar::showContextMenu( TQListViewItem * item, const TQPoint & pos )
{
if ( item != NULL && !m_isReadOnly && m_popupMenu != NULL )
m_popupMenu->exec( pos );
@@ -203,7 +203,7 @@ namespace KBibTeX
void SideBar::startRenaming()
{
- QListViewItem * item = m_listAvailableItems->selectedItem();
+ TQListViewItem * item = m_listAvailableItems->selectedItem();
if ( item == NULL )
item = m_listAvailableItems->currentItem();
@@ -215,7 +215,7 @@ namespace KBibTeX
}
}
- void SideBar::endRenaming( QListViewItem * item, int , const QString & text )
+ void SideBar::endRenaming( TQListViewItem * item, int , const TQString & text )
{
item->setRenameEnabled( 1, FALSE );
BibTeX::EntryField::FieldType fieldType = m_buttonToggleShowAll->isOn() ? ( BibTeX::EntryField::FieldType )( m_listTypeList->currentItem() + ( int ) BibTeX::EntryField::ftAbstract ) : importantFields[ m_listTypeList->currentItem()];
@@ -228,12 +228,12 @@ namespace KBibTeX
emit valueRenamed();
}
- SideBarListViewItem::SideBarListViewItem( QListView *parent, QString label1, QString label2 ) : QListViewItem( parent, label1, label2 )
+ SideBarListViewItem::SideBarListViewItem( TQListView *parent, TQString label1, TQString label2 ) : TQListViewItem( parent, label1, label2 )
{
// nothing
}
- int SideBarListViewItem::compare( QListViewItem* item, int column, bool ascending ) const
+ int SideBarListViewItem::compare( TQListViewItem* item, int column, bool ascending ) const
{
if ( column == 0 )
{
@@ -249,7 +249,7 @@ namespace KBibTeX
}
}
- return QListViewItem::compare( item, column, ascending );
+ return TQListViewItem::compare( item, column, ascending );
}
}
#include "sidebar.moc"