summaryrefslogtreecommitdiffstats
path: root/kmail/snippetwidget.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-16 20:17:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-16 20:17:18 +0000
commitf4fae92b6768541e2952173c3d4b09040f95bf7e (patch)
treed8c5d93232235cd635f3310b4d95490df181ba2d /kmail/snippetwidget.cpp
parent125c0a08265b75a133644d3b55f47e37c919f45d (diff)
downloadtdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.tar.gz
tdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.zip
Moved kpilot from kdepim to applications, as the core Trinity libraries should not contain hardware-dependent software
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1221127 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/snippetwidget.cpp')
-rw-r--r--kmail/snippetwidget.cpp106
1 files changed, 53 insertions, 53 deletions
diff --git a/kmail/snippetwidget.cpp b/kmail/snippetwidget.cpp
index 800a98e55..ef0e07930 100644
--- a/kmail/snippetwidget.cpp
+++ b/kmail/snippetwidget.cpp
@@ -146,7 +146,7 @@ SnippetItem* SnippetWidget::makeItem( SnippetItem* parent, const TQString& name,
{
SnippetItem * item = new SnippetItem(parent, name, text);
const TQString actionName = i18n("Snippet %1").arg(name);
- const TQString normalizedName = TQString(actionName).replace(" ", "_");
+ const TQString normalizedName = TQString(actionName).tqreplace(" ", "_");
if ( !mActionCollection->action(normalizedName.utf8() ) ) {
KAction * action = new KAction( actionName, shortcut, item,
TQT_SLOT( slotExecute() ), mActionCollection,
@@ -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() )
@@ -562,7 +562,7 @@ void SnippetWidget::showPopupMenu( TQListViewItem * item, const TQPoint & p, int
// fn SnippetWidget::parseText(TQString text, TQString del)
/*!
This function is used to parse the given TQString for variables. If found the user will be prompted
- for a replacement value. It returns the string text with all replacements made
+ for a tqreplacement value. It returns the string text with all tqreplacements made
*/
TQString SnippetWidget::parseText(TQString text, TQString del)
{
@@ -597,11 +597,11 @@ TQString SnippetWidget::parseText(TQString text, TQString del)
strNew = ""; //for inputmode "multi" just reset new valaue
}
} else {
- strNew = del; //if double-delimiter -> replace by single character
+ strNew = del; //if double-delimiter -> tqreplace by single character
}
if (iInMeth == 0) { //if input-method "single" is selected
- str.replace(strName, strNew);
+ str.tqreplace(strName, strNew);
}
mapVar[strName] = strNew;
@@ -615,8 +615,8 @@ TQString SnippetWidget::parseText(TQString text, TQString del)
oh = rMulti.top();
if (showMultiVarDialog( &mapVar, &_mapSaved, w, bh, oh )) { //generate and show the dialog
TQMap<TQString, TQString>::Iterator it;
- for ( it = mapVar.begin(); it != mapVar.end(); ++it ) { //walk through the map and do the replacement
- str.replace(it.key(), it.data());
+ for ( it = mapVar.begin(); it != mapVar.end(); ++it ) { //walk through the map and do the tqreplacement
+ str.tqreplace(it.key(), it.data());
}
} else {
return "";
@@ -637,7 +637,7 @@ TQString SnippetWidget::parseText(TQString text, TQString del)
// fn SnippetWidget::showMultiVarDialog()
/*!
- This function constructs a dialog which contains a label and a linedit for every
+ This function constructs a dialog which tqcontains a label and a linedit for every
variable that is stored in the given map except the double-delimiter entry
It return true if everything was ok and false if the user hit cancel
*/
@@ -660,35 +660,35 @@ 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 * 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");
+ TQGridLayout * tqlayout = new TQGridLayout( &dlg, 1, 1, 11, 6, "tqlayout");
+ TQGridLayout * tqlayoutTop = new TQGridLayout( 0, 1, 1, 0, 6, "tqlayoutTop");
+ TQGridLayout * tqlayoutVar = new TQGridLayout( 0, 1, 1, 0, 6, "tqlayoutVar");
+ TQGridLayout * tqlayoutBtn = new TQGridLayout( 0, 1, 1, 0, 6, "tqlayoutBtn");
KTextEdit *te = NULL;
TQLabel * labTop = NULL;
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 );
+ labTop->setText(i18n("Enter the tqreplacement values for these variables:"));
+ tqlayoutTop->addWidget(labTop, 0, 0);
+ tqlayout->addMultiCellLayout( tqlayoutTop, 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;
cb = new TQCheckBox( &dlg, "cbVar" );
cb->setChecked( FALSE );
cb->setText(it.key());
- layoutVar->addWidget( cb, i ,0, Qt::AlignTop );
+ tqlayoutVar->addWidget( cb, i ,0, Qt::AlignTop );
te = new KTextEdit( &dlg, "teVar" );
- layoutVar->addWidget( te, i, 1, Qt::AlignTop );
+ tqlayoutVar->addWidget( te, i, 1, Qt::AlignTop );
if ((*mapSave)[it.key()].length() > 0) {
cb->setChecked( TRUE );
@@ -705,20 +705,20 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ
i++;
}
- layout->addMultiCellLayout( layoutVar, 1, 1, 0, 1 );
+ tqlayout->addMultiCellLayout( tqlayoutVar, 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 );
+ tqlayoutBtn->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 );
+ tqlayoutBtn->addWidget( btn2, 0, 1 );
- layout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 );
+ tqlayout->addMultiCellLayout( tqlayoutBtn, 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() - tqlayoutVar->tqgeometry().height();
+ iOneHeight = tqlayoutVar->tqgeometry().height() / mapVar2Te.count();
+ iWidth = dlg.tqgeometry().width();
}
//do some cleanup
@@ -764,10 +764,10 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ
for (it2 = mapVar2Cb.begin(); it2 != mapVar2Cb.end(); ++it2)
delete it2.data();
mapVar2Cb.clear();
- delete layoutTop;
- delete layoutVar;
- delete layoutBtn;
- delete layout;
+ delete tqlayoutTop;
+ delete tqlayoutVar;
+ delete tqlayoutBtn;
+ delete tqlayout;
if (i==0) //if nothing happened this means, that there are no variables to translate
return true; //.. so just return OK
@@ -779,7 +779,7 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ
// fn SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQString> * mapSave)
/*!
- This function constructs a dialog which contains a label and a linedit for the given variable
+ This function constructs a dialog which tqcontains a label and a linedit for the given variable
It return either the entered value or an empty string if the user hit cancel
*/
TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQString> * mapSave, TQRect & dlgSize)
@@ -788,19 +788,19 @@ 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 * 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");
+ TQGridLayout * tqlayout = new TQGridLayout( &dlg, 1, 1, 11, 6, "tqlayout");
+ TQGridLayout * tqlayoutTop = new TQGridLayout( 0, 1, 1, 0, 6, "tqlayoutTop");
+ TQGridLayout * tqlayoutVar = new TQGridLayout( 0, 1, 1, 0, 6, "tqlayoutVar");
+ TQGridLayout * tqlayoutBtn = new TQGridLayout( 0, 2, 1, 0, 6, "tqlayoutBtn");
KTextEdit *te = NULL;
TQLabel * labTop = NULL;
TQCheckBox * cb = NULL;
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 );
+ tqlayoutTop->addWidget(labTop, 0, 0);
+ labTop->setText(i18n("Enter the tqreplacement values for %1:").arg( var ));
+ tqlayout->addMultiCellLayout( tqlayoutTop, 0, 0, 0, 1 );
cb = new TQCheckBox( &dlg, "cbVar" );
@@ -808,8 +808,8 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri
cb->setText(i18n( "Make value &default" ));
te = new KTextEdit( &dlg, "teVar" );
- layoutVar->addWidget( te, 0, 1, Qt::AlignTop);
- layoutVar->addWidget( cb, 1, 1, Qt::AlignTop);
+ tqlayoutVar->addWidget( te, 0, 1, Qt::AlignTop);
+ tqlayoutVar->addWidget( cb, 1, 1, Qt::AlignTop);
if ((*mapSave)[var].length() > 0) {
cb->setChecked( TRUE );
te->setText((*mapSave)[var]);
@@ -820,16 +820,16 @@ 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( tqlayoutVar, 1, 1, 0, 1 );
KPushButton * btn1 = new KPushButton( KStdGuiItem::cancel(), &dlg, "pushButton1" );
- layoutBtn->addWidget( btn1, 0, 0 );
+ tqlayoutBtn->addWidget( btn1, 0, 0 );
KPushButton * btn2 = new KPushButton( KStdGuiItem::apply(), &dlg, "pushButton2" );
btn2->setDefault( TRUE );
- layoutBtn->addWidget( btn2, 0, 1 );
+ tqlayoutBtn->addWidget( btn2, 0, 1 );
- layout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 );
+ tqlayout->addMultiCellLayout( tqlayoutBtn, 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
@@ -858,10 +858,10 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri
delete labTop;
delete btn1;
delete btn2;
- delete layoutTop;
- delete layoutVar;
- delete layoutBtn;
- delete layout;
+ delete tqlayoutTop;
+ delete tqlayoutVar;
+ delete tqlayoutBtn;
+ 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());