summaryrefslogtreecommitdiffstats
path: root/kbabel/catalogmanager/libcvs/cvsdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbabel/catalogmanager/libcvs/cvsdialog.cpp')
-rw-r--r--kbabel/catalogmanager/libcvs/cvsdialog.cpp128
1 files changed, 64 insertions, 64 deletions
diff --git a/kbabel/catalogmanager/libcvs/cvsdialog.cpp b/kbabel/catalogmanager/libcvs/cvsdialog.cpp
index af76d9d0..090b3de3 100644
--- a/kbabel/catalogmanager/libcvs/cvsdialog.cpp
+++ b/kbabel/catalogmanager/libcvs/cvsdialog.cpp
@@ -33,18 +33,18 @@
// Qt include files
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qfileinfo.h>
-#include <qframe.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlistbox.h>
-#include <qpushbutton.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qtextedit.h>
-#include <qtextcodec.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqfileinfo.h>
+#include <tqframe.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlistbox.h>
+#include <tqpushbutton.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqtextedit.h>
+#include <tqtextcodec.h>
// KDE include files
#include <kconfig.h>
#include <kdebug.h>
@@ -60,16 +60,16 @@
#include "cvsdialog.h"
-CVSDialog::CVSDialog( CVS::Command cmd, QWidget * parent, KSharedConfig* config )
+CVSDialog::CVSDialog( CVS::Command cmd, TQWidget * parent, KSharedConfig* config )
: KDialog( parent, "CVSDIALOG", true ), m_config( config )
{
_cmd = cmd;
p=0L;
setCaption( i18n( "CVS Dialog" ) );
- QString temp;
+ TQString temp;
- QVBoxLayout * layout = new QVBoxLayout( this, 6, 6, "MAIN LAYOUT" );
+ TQVBoxLayout * layout = new TQVBoxLayout( this, 6, 6, "MAIN LAYOUT" );
// Set the label's text depending on the CVS command.
switch ( cmd ) {
@@ -86,54 +86,54 @@ CVSDialog::CVSDialog( CVS::Command cmd, QWidget * parent, KSharedConfig* config
temp = i18n( "Get diff for the following files:" );
break;
}
- layout->addWidget( new QLabel( temp, this ) );
+ layout->addWidget( new TQLabel( temp, this ) );
// Widget for showing the list of files.
- filebox = new QListBox( this );
+ filebox = new TQListBox( this );
layout->addWidget( filebox );
// Add special widgets for 'cvs commit'.
if ( cmd == CVS::Commit ) {
- QLabel * label;
+ TQLabel * label;
// Combobox for displaying old log messages.
- label = new QLabel( i18n( "&Old messages:" ), this );
- oldMessages = new QComboBox( this );
+ label = new TQLabel( i18n( "&Old messages:" ), this );
+ oldMessages = new TQComboBox( this );
oldMessages->setDuplicatesEnabled( false );
label->setBuddy( oldMessages );
layout->addWidget( label );
layout->addWidget( oldMessages );
// Textfield for entering a log message.
- label = new QLabel( i18n( "&Log message:" ), this );
- logedit = new QTextEdit( this );
+ label = new TQLabel( i18n( "&Log message:" ), this );
+ logedit = new TQTextEdit( this );
label->setBuddy( logedit );
layout->addWidget( label );
layout->addWidget( logedit );
- label = new QLabel( i18n( "E&ncoding:" ), this );
+ label = new TQLabel( i18n( "E&ncoding:" ), this );
m_encodingComboBox = new KComboBox( this );
label->setBuddy( m_encodingComboBox );
layout->addWidget( label );
layout->addWidget( m_encodingComboBox );
- QStringList encodingList;
+ TQStringList encodingList;
// The last encoding will be added at the top of the list, when the seetings will be read.
encodingList << i18n( "Descriptive encoding name", "Recommended ( %1 )" ).arg( "UTF-8" );
- encodingList << i18n( "Descriptive encoding name", "Locale ( %1 )" ).arg( QTextCodec::codecForLocale()->mimeName() );
+ encodingList << i18n( "Descriptive encoding name", "Locale ( %1 )" ).arg( TQTextCodec::codecForLocale()->mimeName() );
encodingList += KGlobal::charsets()->descriptiveEncodingNames();
m_encodingComboBox->insertStringList( encodingList );
- connect( oldMessages, SIGNAL( activated( int ) ),
- this, SLOT( slotComboActivated( int ) ) );
+ connect( oldMessages, TQT_SIGNAL( activated( int ) ),
+ this, TQT_SLOT( slotComboActivated( int ) ) );
}
- QHBoxLayout * buttons = new QHBoxLayout( 0, 0, 6, "BUTTON LAYOUT" );
+ TQHBoxLayout * buttons = new TQHBoxLayout( 0, 0, 6, "BUTTON LAYOUT" );
// Add special buttons for 'cvs commit'.
if ( cmd == CVS::Commit ) {
- autoAddBox = new QCheckBox( i18n( "Auto&matically add files if necessary" ), this );
+ autoAddBox = new TQCheckBox( i18n( "Auto&matically add files if necessary" ), this );
buttons->addWidget( autoAddBox );
}
- buttons->addItem( new QSpacerItem( 1, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
+ buttons->addItem( new TQSpacerItem( 1, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum ) );
// Set the main button's text depending on the CVS comand.
switch ( cmd ) {
@@ -150,33 +150,33 @@ CVSDialog::CVSDialog( CVS::Command cmd, QWidget * parent, KSharedConfig* config
temp = i18n( "&Get Diff" );
break;
}
- mainBtn = new QPushButton( temp, this );
+ mainBtn = new TQPushButton( temp, this );
mainBtn->setDefault( true );
buttons->addWidget( mainBtn );
- cancelBtn = new QPushButton( i18n( "C&ancel" ), this );
+ cancelBtn = new TQPushButton( i18n( "C&ancel" ), this );
buttons->addWidget( cancelBtn );
layout->addLayout( buttons );
- QFrame * line = new QFrame( this );
- line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ TQFrame * line = new TQFrame( this );
+ line->setFrameStyle( TQFrame::HLine | TQFrame::Sunken );
layout->addWidget( line );
- layout->addWidget( new QLabel( i18n( "Command output:" ), this ) );
+ layout->addWidget( new TQLabel( i18n( "Command output:" ), this ) );
- output = new QTextEdit( this );
+ output = new TQTextEdit( this );
output->setReadOnly( true );
layout->addWidget( output );
- resize( QSize( 600, 450 ).expandedTo( minimumSizeHint( ) ) );
+ resize( TQSize( 600, 450 ).expandedTo( minimumSizeHint( ) ) );
if ( cmd == CVS::Commit )
logedit->setFocus( );
readSettings( );
- connect( mainBtn, SIGNAL( clicked( ) ), this, SLOT( slotExecuteCommand( ) ) );
- connect( cancelBtn, SIGNAL( clicked( ) ), this, SLOT( reject( ) ) );
+ connect( mainBtn, TQT_SIGNAL( clicked( ) ), this, TQT_SLOT( slotExecuteCommand( ) ) );
+ connect( cancelBtn, TQT_SIGNAL( clicked( ) ), this, TQT_SLOT( reject( ) ) );
}
void CVSDialog::slotComboActivated( int index )
@@ -197,17 +197,17 @@ void CVSDialog::accept( )
KDialog::accept( );
}
-void CVSDialog::setFiles( const QStringList& files )
+void CVSDialog::setFiles( const TQStringList& files )
{
filebox->insertStringList( files );
}
-void CVSDialog::setCommandLine( const QString& command )
+void CVSDialog::setCommandLine( const TQString& command )
{
_commandLine = command;
}
-void CVSDialog::setAddCommand( const QString& command )
+void CVSDialog::setAddCommand( const TQString& command )
{
_addCommand = command;
}
@@ -228,7 +228,7 @@ void CVSDialog::slotExecuteCommand( )
if ( autoAddBox->isChecked( ) && !_addCommand.isEmpty( ) )
_commandLine.prepend( _addCommand );
- const QString msg( logedit->text() );
+ const TQString msg( logedit->text() );
if ( msg.isEmpty() )
{
@@ -240,7 +240,7 @@ void CVSDialog::slotExecuteCommand( )
}
m_encoding = KGlobal::charsets()->encodingForName( m_encodingComboBox->currentText() );
- QTextCodec* codec = QTextCodec::codecForName( m_encoding.utf8() );
+ TQTextCodec* codec = TQTextCodec::codecForName( m_encoding.utf8() );
if ( !codec )
{
@@ -259,10 +259,10 @@ void CVSDialog::slotExecuteCommand( )
// Write the commit log message from the input field to a temporary file
m_tempFile = new KTempFile;
m_tempFile->setAutoDelete( true );
- QTextStream* stream = m_tempFile->textStream();
+ TQTextStream* stream = m_tempFile->textStream();
if ( !stream )
{
- kdError() << "Could not create QTextStream for file " << m_tempFile->name();
+ kdError() << "Could not create TQTextStream for file " << m_tempFile->name();
delete m_tempFile;
m_tempFile = 0;
KMessageBox::error( this, i18n( "Cannot open temporary file for writing. Aborting.") );
@@ -286,7 +286,7 @@ void CVSDialog::slotExecuteCommand( )
// Update the list of log messages
if ( !msg.isEmpty() ) {
- const QString shortLog = KStringHandler::csqueeze( msg, 80 );
+ const TQString shortLog = KStringHandler::csqueeze( msg, 80 );
// Remove the message from the list if it already exists
@@ -301,12 +301,12 @@ void CVSDialog::slotExecuteCommand( )
// Set the KProcess' command line.
*p << _commandLine;
- connect( p, SIGNAL( receivedStdout( KProcess*, char*, int ) ),
- this, SLOT ( slotProcessStdout( KProcess*, char*, int ) ) );
- connect( p, SIGNAL( receivedStderr( KProcess*, char*, int ) ),
- this, SLOT ( slotProcessStderr( KProcess*, char*, int ) ) );
- connect( p, SIGNAL( processExited( KProcess* ) ),
- this, SLOT( slotProcessExited( KProcess* ) ) );
+ connect( p, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ),
+ this, TQT_SLOT ( slotProcessStdout( KProcess*, char*, int ) ) );
+ connect( p, TQT_SIGNAL( receivedStderr( KProcess*, char*, int ) ),
+ this, TQT_SLOT ( slotProcessStderr( KProcess*, char*, int ) ) );
+ connect( p, TQT_SIGNAL( processExited( KProcess* ) ),
+ this, TQT_SLOT( slotProcessExited( KProcess* ) ) );
output->append( i18n( "[ Starting command ]" ) );
@@ -325,22 +325,22 @@ void CVSDialog::slotExecuteCommand( )
void CVSDialog::slotProcessStdout( KProcess*, char * buffer, int len )
{
- output->append( QString::fromLocal8Bit( buffer, len ) );
+ output->append( TQString::fromLocal8Bit( buffer, len ) );
// Set the cursor's position at the end of the output.
output->setCursorPosition( output->lines( ), 0 );
// If the command is 'cvs status' or 'cvs diff' collect the output of stdout.
if ( (_cmd == CVS::Status) || (_cmd == CVS::Diff) )
- _statusOutput += QString::fromLocal8Bit( buffer, len );
+ _statusOutput += TQString::fromLocal8Bit( buffer, len );
}
void CVSDialog::slotProcessStderr( KProcess*, char * buffer, int len )
{
// If an error occurs while executing the command display stderr in
// another color.
- QColor oldColor( output->color( ) );
+ TQColor oldColor( output->color( ) );
output->setColor( Qt::red );
- output->append( QString::fromLocal8Bit( buffer, len ) );
+ output->append( TQString::fromLocal8Bit( buffer, len ) );
output->setColor( oldColor );
output->setCursorPosition( output->lines( ), 0 );
}
@@ -358,7 +358,7 @@ void CVSDialog::slotProcessExited( KProcess * p )
mainBtn->setText( i18n( "&Show Diff" ) );
else
mainBtn->setText( i18n( "&Close" ) );
- connect( mainBtn, SIGNAL( clicked( ) ), this, SLOT( accept( ) ) );
+ connect( mainBtn, TQT_SIGNAL( clicked( ) ), this, TQT_SLOT( accept( ) ) );
// Reenable the button and the log edit now that the process is finished.
mainBtn->setEnabled( true );
@@ -366,7 +366,7 @@ void CVSDialog::slotProcessExited( KProcess * p )
logedit->setEnabled( true );
}
-QString CVSDialog::statusOutput( )
+TQString CVSDialog::statusOutput( )
{
return _statusOutput;
}
@@ -383,14 +383,14 @@ void CVSDialog::readSettings( )
m_logMessages.clear();
m_squeezedLogMessages.clear();
for ( int cnt = 0; cnt < 10; cnt++ )
- if ( config->hasKey( QString( "CommitLogMessage%1" ).arg( cnt ) ) )
+ if ( config->hasKey( TQString( "CommitLogMessage%1" ).arg( cnt ) ) )
{
- const QString logMessage = config->readEntry( QString( "CommitLogMessage%1" ).arg( cnt ) );
+ const TQString logMessage = config->readEntry( TQString( "CommitLogMessage%1" ).arg( cnt ) );
if ( !logMessage.isEmpty() )
{
// If the message is too long, cut it to 80 characters (or the combo box becomes too wide)
// ### FIXME: if the string matches the squeezed 80 chars, it might overwrite another entry
- const QString shortLog = KStringHandler::csqueeze( logMessage );
+ const TQString shortLog = KStringHandler::csqueeze( logMessage );
m_logMessages.append( logMessage );
m_squeezedLogMessages.append( shortLog );
oldMessages->insertItem( shortLog );
@@ -411,9 +411,9 @@ void CVSDialog::saveSettings( )
// Write the log messages to the config file.
int cnt = 0;
- QStringList::const_iterator it;
+ TQStringList::const_iterator it;
for ( it = m_logMessages.constBegin( ); it != m_logMessages.constEnd( ) && cnt < 10 ; ++it, ++cnt )
- config->writeEntry( QString( "CommitLogMessage%1" ).arg( cnt ), *it );
+ config->writeEntry( TQString( "CommitLogMessage%1" ).arg( cnt ), *it );
config->writeEntry( "CVSEncoding", m_encoding );
}