summaryrefslogtreecommitdiffstats
path: root/kmail/snippetwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/snippetwidget.cpp')
-rw-r--r--kmail/snippetwidget.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/kmail/snippetwidget.cpp b/kmail/snippetwidget.cpp
index 128687fc3..aff2e8067 100644
--- a/kmail/snippetwidget.cpp
+++ b/kmail/snippetwidget.cpp
@@ -14,7 +14,7 @@
#include <kurl.h>
#include <kdebug.h>
#include <klocale.h>
-#include <layout.h>
+#include <tqlayout.h>
#include <kpushbutton.h>
#include <klistview.h>
#include <tqheader.h>
@@ -145,7 +145,7 @@ void SnippetWidget::slotAdd()
SnippetItem* SnippetWidget::makeItem( SnippetItem* parent, const TQString& name, const TQString& text, const KShortcut& shortcut )
{
SnippetItem * item = new SnippetItem(parent, name, text);
- const TQString actionName = i18n("Snippet %1").arg(name);
+ const TQString actionName = i18n("Snippet %1").tqarg(name);
const TQString normalizedName = TQString(actionName).replace(" ", "_");
if ( !mActionCollection->action(normalizedName.utf8().data() ) ) {
KAction * action = new KAction( actionName, shortcut, item,
@@ -352,8 +352,8 @@ void SnippetWidget::writeConfig()
SnippetGroup * group = dynamic_cast<SnippetGroup*>(item);
if (group) {
//kdDebug(5006) << "-->GROUP " << item->getName() << group->getId() << " " << iGroupCount<< endl;
- strKeyName=TQString("snippetGroupName_%1").arg(iGroupCount);
- strKeyId=TQString("snippetGroupId_%1").arg(iGroupCount);
+ strKeyName=TQString("snippetGroupName_%1").tqarg(iGroupCount);
+ strKeyId=TQString("snippetGroupId_%1").tqarg(iGroupCount);
_cfg->writeEntry(strKeyName, group->getName());
_cfg->writeEntry(strKeyId, group->getId());
@@ -361,9 +361,9 @@ void SnippetWidget::writeConfig()
iGroupCount++;
} else if (dynamic_cast<SnippetItem*>(item)) {
//kdDebug(5006) << "-->ITEM " << item->getName() << item->getParent() << " " << iSnipCount << endl;
- strKeyName=TQString("snippetName_%1").arg(iSnipCount);
- strKeyText=TQString("snippetText_%1").arg(iSnipCount);
- strKeyId=TQString("snippetParent_%1").arg(iSnipCount);
+ strKeyName=TQString("snippetName_%1").tqarg(iSnipCount);
+ strKeyText=TQString("snippetText_%1").tqarg(iSnipCount);
+ strKeyId=TQString("snippetParent_%1").tqarg(iSnipCount);
_cfg->writeEntry(strKeyName, item->getName());
_cfg->writeEntry(strKeyText, item->getText());
@@ -373,7 +373,7 @@ void SnippetWidget::writeConfig()
assert( action );
const KShortcut& sc = action->shortcut();
if (!sc.isNull() ) {
- _cfg->writeEntry( TQString("snippetShortcut_%1").arg(iSnipCount), sc.toString() );
+ _cfg->writeEntry( TQString("snippetShortcut_%1").tqarg(iSnipCount), sc.toString() );
}
iSnipCount++;
} else {
@@ -389,8 +389,8 @@ void SnippetWidget::writeConfig()
for ( it = _mapSaved.begin(); it != _mapSaved.end(); ++it ) { //write the saved variable values
if (it.data().length()<=0) continue; //is the saved value has no length -> no need to save it
- strKeyName=TQString("snippetSavedName_%1").arg(iCount);
- strKeyText=TQString("snippetSavedVal_%1").arg(iCount);
+ strKeyName=TQString("snippetSavedName_%1").tqarg(iCount);
+ strKeyText=TQString("snippetSavedVal_%1").tqarg(iCount);
_cfg->writeEntry(strKeyName, it.key());
_cfg->writeEntry(strKeyText, it.data());
@@ -434,8 +434,8 @@ void SnippetWidget::initConfig()
int iCount = _cfg->readNumEntry("snippetGroupCount", -1);
for ( int i=0; i<iCount; i++) { //read the group-list
- strKeyName=TQString("snippetGroupName_%1").arg(i);
- strKeyId=TQString("snippetGroupId_%1").arg(i);
+ strKeyName=TQString("snippetGroupName_%1").tqarg(i);
+ strKeyId=TQString("snippetGroupId_%1").tqarg(i);
TQString strNameVal="";
int iIdVal=-1;
@@ -460,9 +460,9 @@ void SnippetWidget::initConfig()
if (iCount != -1) {
iCount = _cfg->readNumEntry("snippetCount", 0);
for ( int i=0; i<iCount; i++) { //read the snippet-list
- strKeyName=TQString("snippetName_%1").arg(i);
- strKeyText=TQString("snippetText_%1").arg(i);
- strKeyId=TQString("snippetParent_%1").arg(i);
+ strKeyName=TQString("snippetName_%1").tqarg(i);
+ strKeyText=TQString("snippetText_%1").tqarg(i);
+ strKeyId=TQString("snippetParent_%1").tqarg(i);
TQString strNameVal="";
TQString strTextVal="";
@@ -474,7 +474,7 @@ void SnippetWidget::initConfig()
//kdDebug(5006) << "Read item " << strNameVal << " " << iParentVal << endl;
if (strNameVal != "" && strTextVal != "" && iParentVal != -1) {
- KShortcut shortcut( _cfg->readEntry( TQString("snippetShortcut_%1").arg(i), TQString() ) );
+ KShortcut shortcut( _cfg->readEntry( TQString("snippetShortcut_%1").tqarg(i), TQString() ) );
item = makeItem( SnippetItem::findGroupById(iParentVal, _list), strNameVal, strTextVal, shortcut );
//kdDebug(5006) << "Created item " << item->getName() << " " << item->getParent() << endl;
_list.append(item);
@@ -487,8 +487,8 @@ void SnippetWidget::initConfig()
iCount = _cfg->readNumEntry("snippetSavedCount", 0);
for ( int i=1; i<=iCount; i++) { //read the saved-values and store in TQMap
- strKeyName=TQString("snippetSavedName_%1").arg(i);
- strKeyText=TQString("snippetSavedVal_%1").arg(i);
+ strKeyName=TQString("snippetSavedName_%1").tqarg(i);
+ strKeyText=TQString("snippetSavedVal_%1").tqarg(i);
TQString strNameVal="";
TQString strTextVal="";
@@ -521,7 +521,7 @@ void SnippetWidget::maybeTip( const TQPoint & p )
if (!item)
return;
- TQRect r = itemRect( item );
+ TQRect r = tqitemRect( item );
if (r.isValid() &&
_SnippetConfig.useToolTips() )
@@ -586,7 +586,7 @@ TQString SnippetWidget::parseText(TQString text, TQString del)
if ( strName != del+del ) { //if not doubel-delimiter
if (iInMeth == 0) { //if input-method "single" is selected
if ( mapVar[strName].length() <= 0 ) { // and not already in map
- strMsg=i18n("Please enter the value for <b>%1</b>:").arg(strName);
+ strMsg=i18n("Please enter the value for <b>%1</b>:").tqarg(strName);
strNew = showSingleVarDialog( strName, &_mapSaved, rSingle );
if (strNew=="")
return ""; //user clicked Cancle
@@ -660,7 +660,7 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ
TQDialog dlg(this);
dlg.setCaption(i18n("Enter Values for Variables"));
- TQGridLayout * layout = new TQGridLayout( &dlg, 1, 1, 11, 6, "layout");
+ TQGridLayout * tqlayout = new TQGridLayout( &dlg, 1, 1, 11, 6, "tqlayout");
TQGridLayout * layoutTop = new TQGridLayout( 0, 1, 1, 0, 6, "layoutTop");
TQGridLayout * layoutVar = new TQGridLayout( 0, 1, 1, 0, 6, "layoutVar");
TQGridLayout * layoutBtn = new TQGridLayout( 0, 1, 1, 0, 6, "layoutBtn");
@@ -670,15 +670,15 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ
TQCheckBox * cb = NULL;
labTop = new TQLabel( &dlg, "label" );
- labTop->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0,
+ labTop->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0,
labTop->sizePolicy().hasHeightForWidth() ) );
labTop->setText(i18n("Enter the replacement values for these variables:"));
layoutTop->addWidget(labTop, 0, 0);
- layout->addMultiCellLayout( layoutTop, 0, 0, 0, 1 );
+ tqlayout->addMultiCellLayout( layoutTop, 0, 0, 0, 1 );
int i = 0; //walk through the variable map and add
- for ( it = map->begin(); it != map->end(); ++it ) { //a checkbox, a lable and a lineedit to the main layout
+ for ( it = map->begin(); it != map->end(); ++it ) { //a checkbox, a lable and a lineedit to the main tqlayout
if (it.key() == _SnippetConfig.getDelimiter() + _SnippetConfig.getDelimiter())
continue;
@@ -705,20 +705,20 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ
i++;
}
- layout->addMultiCellLayout( layoutVar, 1, 1, 0, 1 );
+ tqlayout->addMultiCellLayout( layoutVar, 1, 1, 0, 1 );
KPushButton * btn1 = new KPushButton( KStdGuiItem::cancel(), &dlg, "pushButton1" );
- btn1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0,
+ btn1->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0,
btn1->sizePolicy().hasHeightForWidth() ) );
layoutBtn->addWidget( btn1, 0, 0 );
KPushButton * btn2 = new KPushButton( KStdGuiItem::apply(), &dlg, "pushButton2" );
btn2->setDefault( TRUE );
- btn2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0,
+ btn2->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0,
btn2->sizePolicy().hasHeightForWidth() ) );
layoutBtn->addWidget( btn2, 0, 1 );
- layout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 );
+ tqlayout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 );
// --END-- building a dynamic dialog
//connect the buttons to the TQDialog default slots
@@ -729,7 +729,7 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ
bool bReturn = false;
//resize the textedits
if (iWidth > 1) {
- TQRect r = dlg.geometry();
+ TQRect r = dlg.tqgeometry();
r.setHeight(iBasicHeight + iOneHeight*mapVar2Te.count());
r.setWidth(iWidth);
dlg.setGeometry(r);
@@ -750,9 +750,9 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ
}
bReturn = true;
- iBasicHeight = dlg.geometry().height() - layoutVar->geometry().height();
- iOneHeight = layoutVar->geometry().height() / mapVar2Te.count();
- iWidth = dlg.geometry().width();
+ iBasicHeight = dlg.tqgeometry().height() - layoutVar->tqgeometry().height();
+ iOneHeight = layoutVar->tqgeometry().height() / mapVar2Te.count();
+ iWidth = dlg.tqgeometry().width();
}
//do some cleanup
@@ -767,7 +767,7 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ
delete layoutTop;
delete layoutVar;
delete layoutBtn;
- delete layout;
+ delete tqlayout;
if (i==0) //if nothing happened this means, that there are no variables to translate
return true; //.. so just return OK
@@ -788,7 +788,7 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri
TQDialog dlg(this);
dlg.setCaption(i18n("Enter Values for Variables"));
- TQGridLayout * layout = new TQGridLayout( &dlg, 1, 1, 11, 6, "layout");
+ TQGridLayout * tqlayout = new TQGridLayout( &dlg, 1, 1, 11, 6, "tqlayout");
TQGridLayout * layoutTop = new TQGridLayout( 0, 1, 1, 0, 6, "layoutTop");
TQGridLayout * layoutVar = new TQGridLayout( 0, 1, 1, 0, 6, "layoutVar");
TQGridLayout * layoutBtn = new TQGridLayout( 0, 2, 1, 0, 6, "layoutBtn");
@@ -799,8 +799,8 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri
labTop = new TQLabel( &dlg, "label" );
layoutTop->addWidget(labTop, 0, 0);
- labTop->setText(i18n("Enter the replacement values for %1:").arg( var ));
- layout->addMultiCellLayout( layoutTop, 0, 0, 0, 1 );
+ labTop->setText(i18n("Enter the replacement values for %1:").tqarg( var ));
+ tqlayout->addMultiCellLayout( layoutTop, 0, 0, 0, 1 );
cb = new TQCheckBox( &dlg, "cbVar" );
@@ -820,7 +820,7 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri
"If you use the same variable later, even in another snippet, the value entered to the right "
"will be the default value for that variable.") );
- layout->addMultiCellLayout( layoutVar, 1, 1, 0, 1 );
+ tqlayout->addMultiCellLayout( layoutVar, 1, 1, 0, 1 );
KPushButton * btn1 = new KPushButton( KStdGuiItem::cancel(), &dlg, "pushButton1" );
layoutBtn->addWidget( btn1, 0, 0 );
@@ -829,7 +829,7 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri
btn2->setDefault( TRUE );
layoutBtn->addWidget( btn2, 0, 1 );
- layout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 );
+ tqlayout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 );
te->setFocus();
// --END-- building a dynamic dialog
@@ -849,7 +849,7 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri
strReturn = te->text(); //copy the entered values back the the given map
- dlgSize = dlg.geometry();
+ dlgSize = dlg.tqgeometry();
}
//do some cleanup
@@ -861,7 +861,7 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri
delete layoutTop;
delete layoutVar;
delete layoutBtn;
- delete layout;
+ delete tqlayout;
return strReturn;
}
@@ -912,7 +912,7 @@ void SnippetWidget::slotDropped(TQDropEvent *e, TQListViewItem *)
group = dynamic_cast<SnippetGroup *>(item2->parent());
TQCString dropped;
- TQByteArray data = e->encodedData("text/plain");
+ TQByteArray data = e->tqencodedData("text/plain");
if ( e->provides("text/plain") && data.size()>0 ) {
//get the data from the event...
TQString encData(data.data());