summaryrefslogtreecommitdiffstats
path: root/src/noteedit.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 08:20:48 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 08:20:48 +0000
commitaa0726b20f398264f0a2abc60215be044b106f9c (patch)
tree070fdbc19a1106cfdd7f651a8ce76bb1b89a513d /src/noteedit.cpp
parentd3cf5b3e75aadc3b02d0b56f030d4c3f8c2c749d (diff)
downloadbasket-aa0726b20f398264f0a2abc60215be044b106f9c.tar.gz
basket-aa0726b20f398264f0a2abc60215be044b106f9c.zip
TQt4 port basket
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/basket@1232416 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/noteedit.cpp')
-rw-r--r--src/noteedit.cpp358
1 files changed, 179 insertions, 179 deletions
diff --git a/src/noteedit.cpp b/src/noteedit.cpp
index b2d25dd..1727164 100644
--- a/src/noteedit.cpp
+++ b/src/noteedit.cpp
@@ -18,9 +18,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlineedit.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
#include <klineedit.h>
#include <kurlrequester.h>
#include <kicondialog.h>
@@ -67,48 +67,48 @@ Note* NoteEditor::note()
return m_noteContent->note();
}
-NoteEditor* NoteEditor::editNoteContent(NoteContent *noteContent, QWidget *parent)
+NoteEditor* NoteEditor::editNoteContent(NoteContent *noteContent, TQWidget *tqparent)
{
TextContent *textContent = dynamic_cast<TextContent*>(noteContent);
if (textContent)
- return new TextEditor(textContent, parent);
+ return new TextEditor(textContent, tqparent);
HtmlContent *htmlContent = dynamic_cast<HtmlContent*>(noteContent);
if (htmlContent)
- return new HtmlEditor(htmlContent, parent);
+ return new HtmlEditor(htmlContent, tqparent);
ImageContent *imageContent = dynamic_cast<ImageContent*>(noteContent);
if (imageContent)
- return new ImageEditor(imageContent, parent);
+ return new ImageEditor(imageContent, tqparent);
AnimationContent *animationContent = dynamic_cast<AnimationContent*>(noteContent);
if (animationContent)
- return new AnimationEditor(animationContent, parent);
+ return new AnimationEditor(animationContent, tqparent);
FileContent *fileContent = dynamic_cast<FileContent*>(noteContent); // Same for SoundContent
if (fileContent)
- return new FileEditor(fileContent, parent);
+ return new FileEditor(fileContent, tqparent);
LinkContent *linkContent = dynamic_cast<LinkContent*>(noteContent);
if (linkContent)
- return new LinkEditor(linkContent, parent);
+ return new LinkEditor(linkContent, tqparent);
LauncherContent *launcherContent = dynamic_cast<LauncherContent*>(noteContent);
if (launcherContent)
- return new LauncherEditor(launcherContent, parent);
+ return new LauncherEditor(launcherContent, tqparent);
ColorContent *colorContent = dynamic_cast<ColorContent*>(noteContent);
if (colorContent)
- return new ColorEditor(colorContent, parent);
+ return new ColorEditor(colorContent, tqparent);
UnknownContent *unknownContent = dynamic_cast<UnknownContent*>(noteContent);
if (unknownContent)
- return new UnknownEditor(unknownContent, parent);
+ return new UnknownEditor(unknownContent, tqparent);
return 0;
}
-void NoteEditor::setInlineEditor(QWidget *inlineEditor)
+void NoteEditor::setInlineEditor(TQWidget *inlineEditor)
{
m_widget = inlineEditor;
m_textEdit = 0;
@@ -118,7 +118,7 @@ void NoteEditor::setInlineEditor(QWidget *inlineEditor)
if (textEdit)
m_textEdit = textEdit;
else {
- QLineEdit *lineEdit = dynamic_cast<QLineEdit*>(inlineEditor);
+ TQLineEdit *lineEdit = dynamic_cast<TQLineEdit*>(inlineEditor);
if (lineEdit)
m_lineEdit = lineEdit;
}
@@ -128,29 +128,29 @@ void NoteEditor::setInlineEditor(QWidget *inlineEditor)
/** class TextEditor: */
-TextEditor::TextEditor(TextContent *textContent, QWidget *parent)
+TextEditor::TextEditor(TextContent *textContent, TQWidget *tqparent)
: NoteEditor(textContent), m_textContent(textContent)
{
- FocusedTextEdit *textEdit = new FocusedTextEdit(/*disableUpdatesOnKeyPress=*/true, parent);
+ FocusedTextEdit *textEdit = new FocusedTextEdit(/*disableUpdatesOnKeyPress=*/true, tqparent);
textEdit->setLineWidth(0);
textEdit->setMidLineWidth(0);
- textEdit->setTextFormat(Qt::PlainText);
+ textEdit->setTextFormat(TQt::PlainText);
textEdit->setPaletteBackgroundColor(note()->backgroundColor());
textEdit->setPaletteForegroundColor(note()->textColor());
textEdit->setFont(note()->font());
- textEdit->setHScrollBarMode(QScrollView::AlwaysOff);
+ textEdit->setHScrollBarMode(TQScrollView::AlwaysOff);
if (Settings::spellCheckTextNotes())
textEdit->setCheckSpellingEnabled(true);
textEdit->setText(m_textContent->text());
textEdit->moveCursor(KTextEdit::MoveEnd, false); // FIXME: Sometimes, the cursor flicker at ends before being positionned where clicked (because kapp->processEvents() I think)
- textEdit->verticalScrollBar()->setCursor(Qt::ArrowCursor);
+ textEdit->verticalScrollBar()->setCursor(TQt::ArrowCursor);
setInlineEditor(textEdit);
- connect( textEdit, SIGNAL(escapePressed()), this, SIGNAL(askValidation()) );
- connect( textEdit, SIGNAL(mouseEntered()), this, SIGNAL(mouseEnteredEditorWidget()) );
+ connect( textEdit, TQT_SIGNAL(escapePressed()), this, TQT_SIGNAL(askValidation()) );
+ connect( textEdit, TQT_SIGNAL(mouseEntered()), this, TQT_SIGNAL(mouseEnteredEditorWidget()) );
- connect( textEdit, SIGNAL(cursorPositionChanged(int, int)), textContent->note()->basket(), SLOT(editorCursorPositionChanged()) );
+ connect( textEdit, TQT_SIGNAL(cursorPositionChanged(int, int)), textContent->note()->basket(), TQT_SLOT(editorCursorPositionChanged()) );
// In case it is a very big note, the top is displayed and Enter is pressed: the cursor is on bottom, we should enure it visible:
- QTimer::singleShot( 0, textContent->note()->basket(), SLOT(editorCursorPositionChanged()) );
+ TQTimer::singleShot( 0, textContent->note()->basket(), TQT_SLOT(editorCursorPositionChanged()) );
}
TextEditor::~TextEditor()
@@ -199,75 +199,75 @@ void TextEditor::validate()
/** class HtmlEditor: */
-HtmlEditor::HtmlEditor(HtmlContent *htmlContent, QWidget *parent)
+HtmlEditor::HtmlEditor(HtmlContent *htmlContent, TQWidget *tqparent)
: NoteEditor(htmlContent), m_htmlContent(htmlContent)
{
- FocusedTextEdit *textEdit = new FocusedTextEdit(/*disableUpdatesOnKeyPress=*/true, parent);
+ FocusedTextEdit *textEdit = new FocusedTextEdit(/*disableUpdatesOnKeyPress=*/true, tqparent);
textEdit->setLineWidth(0);
textEdit->setMidLineWidth(0);
- textEdit->setTextFormat(Qt::RichText);
- textEdit->setAutoFormatting(Settings::autoBullet() ? QTextEdit::AutoAll : QTextEdit::AutoNone);
+ textEdit->setTextFormat(TQt::RichText);
+ textEdit->setAutoFormatting(Settings::autoBullet() ? TQTextEdit::AutoAll : TQTextEdit::AutoNone);
textEdit->setPaletteBackgroundColor(note()->backgroundColor());
textEdit->setPaletteForegroundColor(note()->textColor());
textEdit->setFont(note()->font());
- textEdit->setHScrollBarMode(QScrollView::AlwaysOff);
+ textEdit->setHScrollBarMode(TQScrollView::AlwaysOff);
textEdit->setText(m_htmlContent->html());
textEdit->moveCursor(KTextEdit::MoveEnd, false);
- textEdit->verticalScrollBar()->setCursor(Qt::ArrowCursor);
+ textEdit->verticalScrollBar()->setCursor(TQt::ArrowCursor);
setInlineEditor(textEdit);
- connect( textEdit, SIGNAL(mouseEntered()), this, SIGNAL(mouseEnteredEditorWidget()) );
- connect( textEdit, SIGNAL(escapePressed()), this, SIGNAL(askValidation()) );
+ connect( textEdit, TQT_SIGNAL(mouseEntered()), this, TQT_SIGNAL(mouseEnteredEditorWidget()) );
+ connect( textEdit, TQT_SIGNAL(escapePressed()), this, TQT_SIGNAL(askValidation()) );
- connect( InlineEditors::instance()->richTextFont, SIGNAL(textChanged(const QString&)), textEdit, SLOT(setFamily(const QString&)) );
- connect( InlineEditors::instance()->richTextFontSize, SIGNAL(sizeChanged(int)), textEdit, SLOT(setPointSize(int)) );
- connect( InlineEditors::instance()->richTextColor, SIGNAL(activated(const QColor&)), textEdit, SLOT(setColor(const QColor&)) );
+ connect( InlineEditors::instance()->richTextFont, TQT_SIGNAL(textChanged(const TQString&)), textEdit, TQT_SLOT(setFamily(const TQString&)) );
+ connect( InlineEditors::instance()->richTextFontSize, TQT_SIGNAL(sizeChanged(int)), textEdit, TQT_SLOT(setPointSize(int)) );
+ connect( InlineEditors::instance()->richTextColor, TQT_SIGNAL(activated(const TQColor&)), textEdit, TQT_SLOT(setColor(const TQColor&)) );
- connect( InlineEditors::instance()->richTextFont, SIGNAL(escapePressed()), textEdit, SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextFont, SIGNAL(returnPressed2()), textEdit, SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextFont, SIGNAL(activated(int)), textEdit, SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextFont, TQT_SIGNAL(escapePressed()), textEdit, TQT_SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextFont, TQT_SIGNAL(returnPressed2()), textEdit, TQT_SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextFont, TQT_SIGNAL(activated(int)), textEdit, TQT_SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextFontSize, SIGNAL(escapePressed()), textEdit, SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextFontSize, SIGNAL(returnPressed2()), textEdit, SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextFontSize, SIGNAL(activated(int)), textEdit, SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextFontSize, TQT_SIGNAL(escapePressed()), textEdit, TQT_SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextFontSize, TQT_SIGNAL(returnPressed2()), textEdit, TQT_SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextFontSize, TQT_SIGNAL(activated(int)), textEdit, TQT_SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextColor, SIGNAL(escapePressed()), textEdit, SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextColor, SIGNAL(returnPressed2()), textEdit, SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextColor, TQT_SIGNAL(escapePressed()), textEdit, TQT_SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextColor, TQT_SIGNAL(returnPressed2()), textEdit, TQT_SLOT(setFocus()) );
- connect( textEdit, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(cursorPositionChanged()) );
- connect( textEdit, SIGNAL(clicked(int, int)), this, SLOT(cursorPositionChanged()) );
- connect( textEdit, SIGNAL(currentFontChanged(const QFont&)), this, SLOT(fontChanged(const QFont&)) );
-// connect( textEdit, SIGNAL(currentVerticalAlignmentChanged(VerticalAlignment)), this, SLOT(slotVerticalAlignmentChanged()) );
+ connect( textEdit, TQT_SIGNAL(cursorPositionChanged(int, int)), this, TQT_SLOT(cursorPositionChanged()) );
+ connect( textEdit, TQT_SIGNAL(clicked(int, int)), this, TQT_SLOT(cursorPositionChanged()) );
+ connect( textEdit, TQT_SIGNAL(currentFontChanged(const TQFont&)), this, TQT_SLOT(fontChanged(const TQFont&)) );
+// connect( textEdit, TQT_SIGNAL(currentVerticalAlignmentChangedQt::VerticalAlignment)), this, TQT_SLOT(slotVerticalAlignmentChanged()) );
- connect( InlineEditors::instance()->richTextBold, SIGNAL(toggled(bool)), textEdit, SLOT(setBold(bool)) );
- connect( InlineEditors::instance()->richTextItalic, SIGNAL(toggled(bool)), textEdit, SLOT(setItalic(bool)) );
- connect( InlineEditors::instance()->richTextUnderline, SIGNAL(toggled(bool)), textEdit, SLOT(setUnderline(bool)) );
+ connect( InlineEditors::instance()->richTextBold, TQT_SIGNAL(toggled(bool)), textEdit, TQT_SLOT(setBold(bool)) );
+ connect( InlineEditors::instance()->richTextItalic, TQT_SIGNAL(toggled(bool)), textEdit, TQT_SLOT(setItalic(bool)) );
+ connect( InlineEditors::instance()->richTextUnderline, TQT_SIGNAL(toggled(bool)), textEdit, TQT_SLOT(setUnderline(bool)) );
//REMOVE:
- //connect( InlineEditors::instance()->richTextBold, SIGNAL(activated()), this, SLOT(setBold()) );
- //connect( InlineEditors::instance()->richTextItalic, SIGNAL(activated()), this, SLOT(setItalic()) );
- //connect( InlineEditors::instance()->richTextUnderline, SIGNAL(activated()), this, SLOT(setUnderline()) );
- connect( InlineEditors::instance()->richTextLeft, SIGNAL(activated()), this, SLOT(setLeft()) );
- connect( InlineEditors::instance()->richTextCenter, SIGNAL(activated()), this, SLOT(setCentered()) );
- connect( InlineEditors::instance()->richTextRight, SIGNAL(activated()), this, SLOT(setRight()) );
- connect( InlineEditors::instance()->richTextJustified, SIGNAL(activated()), this, SLOT(setBlock()) );
+ //connect( InlineEditors::instance()->richTextBold, TQT_SIGNAL(activated()), this, TQT_SLOT(setBold()) );
+ //connect( InlineEditors::instance()->richTextItalic, TQT_SIGNAL(activated()), this, TQT_SLOT(setItalic()) );
+ //connect( InlineEditors::instance()->richTextUnderline, TQT_SIGNAL(activated()), this, TQT_SLOT(setUnderline()) );
+ connect( InlineEditors::instance()->richTextLeft, TQT_SIGNAL(activated()), this, TQT_SLOT(setLeft()) );
+ connect( InlineEditors::instance()->richTextCenter, TQT_SIGNAL(activated()), this, TQT_SLOT(setCentered()) );
+ connect( InlineEditors::instance()->richTextRight, TQT_SIGNAL(activated()), this, TQT_SLOT(setRight()) );
+ connect( InlineEditors::instance()->richTextJustified, TQT_SIGNAL(activated()), this, TQT_SLOT(setBlock()) );
// InlineEditors::instance()->richTextToolBar()->show();
cursorPositionChanged();
fontChanged(textEdit->currentFont());
- //QTimer::singleShot( 0, this, SLOT(cursorPositionChanged()) );
+ //TQTimer::singleShot( 0, this, TQT_SLOT(cursorPositionChanged()) );
InlineEditors::instance()->enableRichTextToolBar();
- connect( InlineEditors::instance()->richTextUndo, SIGNAL(activated()), textEdit, SLOT(undo()) );
- connect( InlineEditors::instance()->richTextRedo, SIGNAL(activated()), textEdit, SLOT(redo()) );
- connect( textEdit, SIGNAL(undoAvailable(bool)), InlineEditors::instance()->richTextUndo, SLOT(setEnabled(bool)) );
- connect( textEdit, SIGNAL(redoAvailable(bool)), InlineEditors::instance()->richTextRedo, SLOT(setEnabled(bool)) );
- connect( textEdit, SIGNAL(textChanged()), this, SLOT(textChanged()));
+ connect( InlineEditors::instance()->richTextUndo, TQT_SIGNAL(activated()), textEdit, TQT_SLOT(undo()) );
+ connect( InlineEditors::instance()->richTextRedo, TQT_SIGNAL(activated()), textEdit, TQT_SLOT(redo()) );
+ connect( textEdit, TQT_SIGNAL(undoAvailable(bool)), InlineEditors::instance()->richTextUndo, TQT_SLOT(setEnabled(bool)) );
+ connect( textEdit, TQT_SIGNAL(redoAvailable(bool)), InlineEditors::instance()->richTextRedo, TQT_SLOT(setEnabled(bool)) );
+ connect( textEdit, TQT_SIGNAL(textChanged()), this, TQT_SLOT(textChanged()));
InlineEditors::instance()->richTextUndo->setEnabled(false);
InlineEditors::instance()->richTextRedo->setEnabled(false);
- connect( textEdit, SIGNAL(cursorPositionChanged(int, int)), htmlContent->note()->basket(), SLOT(editorCursorPositionChanged()) );
+ connect( textEdit, TQT_SIGNAL(cursorPositionChanged(int, int)), htmlContent->note()->basket(), TQT_SLOT(editorCursorPositionChanged()) );
// In case it is a very big note, the top is displayed and Enter is pressed: the cursor is on bottom, we should enure it visible:
- QTimer::singleShot( 0, htmlContent->note()->basket(), SLOT(editorCursorPositionChanged()) );
+ TQTimer::singleShot( 0, htmlContent->note()->basket(), TQT_SLOT(editorCursorPositionChanged()) );
}
void HtmlEditor::cursorPositionChanged()
@@ -279,18 +279,18 @@ void HtmlEditor::cursorPositionChanged()
InlineEditors::instance()->richTextItalic->setChecked( textEdit()->italic() );
InlineEditors::instance()->richTextUnderline->setChecked( textEdit()->underline() );
- switch (textEdit()->alignment()) {
+ switch (textEdit()->tqalignment()) {
default:
- case 1/*Qt::AlignLeft*/: InlineEditors::instance()->richTextLeft->setChecked(true); break;
- case 4/*Qt::AlignCenter*/: InlineEditors::instance()->richTextCenter->setChecked(true); break;
- case 2/*Qt::AlignRight*/: InlineEditors::instance()->richTextRight->setChecked(true); break;
- case -8/*Qt::AlignJustify*/: InlineEditors::instance()->richTextJustified->setChecked(true); break;
+ case 1/*TQt::AlignLeft*/: InlineEditors::instance()->richTextLeft->setChecked(true); break;
+ case 4/*TQt::AlignCenter*/: InlineEditors::instance()->richTextCenter->setChecked(true); break;
+ case 2/*TQt::AlignRight*/: InlineEditors::instance()->richTextRight->setChecked(true); break;
+ case -8/*TQt::AlignJustify*/: InlineEditors::instance()->richTextJustified->setChecked(true); break;
}
}
void HtmlEditor::textChanged()
{
- // The following is a workaround for an apparent Qt bug.
+ // The following is a workaround for an aptqparent TQt bug.
// When I start typing in a textEdit, the undo&redo actions are not enabled until I click
// or move the cursor - probably, the signal undoAvailable() is not emitted.
// So, I had to intervene and do that manually.
@@ -298,14 +298,14 @@ void HtmlEditor::textChanged()
InlineEditors::instance()->richTextRedo->setEnabled(textEdit()->isRedoAvailable());
}
-void HtmlEditor::fontChanged(const QFont &font)
+void HtmlEditor::fontChanged(const TQFont &font)
{
InlineEditors::instance()->richTextFontSize->setFontSize(font.pointSize());
}
-/*void HtmlEditor::slotVe<rticalAlignmentChanged(QTextEdit::VerticalAlignment align)
+/*void HtmlEditor::slotVe<rticalAlignmentChanged(TQTextEdit::VerticalAlignment align)
{
- QTextEdit::VerticalAlignment align = textEdit()
+ TQTextEdit::VerticalAlignment align = textEdit()
switch (align) {
case KTextEdit::AlignSuperScript:
InlineEditors::instance()->richTextSuper->setChecked(true);
@@ -337,10 +337,10 @@ void HtmlEditor::fontChanged(const QFont &font)
//void HtmlEditor::setBold() { textEdit()->setBold( InlineEditors::instance()->richTextBold->isChecked() ); }
//void HtmlEditor::setItalic() { textEdit()->setItalic( InlineEditors::instance()->richTextItalic->isChecked() ); }
//void HtmlEditor::setUnderline() { textEdit()->setUnderline( InlineEditors::instance()->richTextUnderline->isChecked() ); }
-void HtmlEditor::setLeft() { textEdit()->setAlignment(Qt::AlignLeft); }
-void HtmlEditor::setCentered() { textEdit()->setAlignment(Qt::AlignCenter); }
-void HtmlEditor::setRight() { textEdit()->setAlignment(Qt::AlignRight); }
-void HtmlEditor::setBlock() { textEdit()->setAlignment(Qt::AlignJustify); }
+void HtmlEditor::setLeft() { textEdit()->tqsetAlignment(TQt::AlignLeft); }
+void HtmlEditor::setCentered() { textEdit()->tqsetAlignment(TQt::AlignCenter); }
+void HtmlEditor::setRight() { textEdit()->tqsetAlignment(TQt::AlignRight); }
+void HtmlEditor::setBlock() { textEdit()->tqsetAlignment(TQt::AlignJustify); }
HtmlEditor::~HtmlEditor()
{
@@ -378,10 +378,10 @@ void HtmlEditor::validate()
/** class ImageEditor: */
-ImageEditor::ImageEditor(ImageContent *imageContent, QWidget *parent)
+ImageEditor::ImageEditor(ImageContent *imageContent, TQWidget *tqparent)
: NoteEditor(imageContent)
{
- int choice = KMessageBox::questionYesNo(parent, i18n(
+ int choice = KMessageBox::questionYesNo(tqparent, i18n(
"Images can not be edited here at the moment (the next version of BasKet Note Pads will include an image editor).\n"
"Do you want to open it with an application that understand it?"),
i18n("Edit Image Note"),
@@ -394,10 +394,10 @@ ImageEditor::ImageEditor(ImageContent *imageContent, QWidget *parent)
/** class AnimationEditor: */
-AnimationEditor::AnimationEditor(AnimationContent *animationContent, QWidget *parent)
+AnimationEditor::AnimationEditor(AnimationContent *animationContent, TQWidget *tqparent)
: NoteEditor(animationContent)
{
- int choice = KMessageBox::questionYesNo(parent, i18n(
+ int choice = KMessageBox::questionYesNo(tqparent, i18n(
"This animated image can not be edited here.\n"
"Do you want to open it with an application that understands it?"),
i18n("Edit Animation Note"),
@@ -410,10 +410,10 @@ AnimationEditor::AnimationEditor(AnimationContent *animationContent, QWidget *pa
/** class FileEditor: */
-FileEditor::FileEditor(FileContent *fileContent, QWidget *parent)
+FileEditor::FileEditor(FileContent *fileContent, TQWidget *tqparent)
: NoteEditor(fileContent), m_fileContent(fileContent)
{
- FocusedLineEdit *lineEdit = new FocusedLineEdit(parent);
+ FocusedLineEdit *lineEdit = new FocusedLineEdit(tqparent);
lineEdit->setLineWidth(0);
lineEdit->setMidLineWidth(0);
lineEdit->setPaletteBackgroundColor(note()->backgroundColor());
@@ -422,9 +422,9 @@ FileEditor::FileEditor(FileContent *fileContent, QWidget *parent)
lineEdit->setText(m_fileContent->fileName());
lineEdit->selectAll();
setInlineEditor(lineEdit);
- connect( lineEdit, SIGNAL(returnPressed()), this, SIGNAL(askValidation()) );
- connect( lineEdit, SIGNAL(escapePressed()), this, SIGNAL(askValidation()) );
- connect( lineEdit, SIGNAL(mouseEntered()), this, SIGNAL(mouseEnteredEditorWidget()) );
+ connect( lineEdit, TQT_SIGNAL(returnPressed()), this, TQT_SIGNAL(askValidation()) );
+ connect( lineEdit, TQT_SIGNAL(escapePressed()), this, TQT_SIGNAL(askValidation()) );
+ connect( lineEdit, TQT_SIGNAL(mouseEntered()), this, TQT_SIGNAL(mouseEnteredEditorWidget()) );
}
FileEditor::~FileEditor()
@@ -448,11 +448,11 @@ void FileEditor::validate()
/** class LinkEditor: */
-LinkEditor::LinkEditor(LinkContent *linkContent, QWidget *parent)
+LinkEditor::LinkEditor(LinkContent *linkContent, TQWidget *tqparent)
: NoteEditor(linkContent)
{
- LinkEditDialog dialog(linkContent, parent);
- if (dialog.exec() == QDialog::Rejected)
+ LinkEditDialog dialog(linkContent, tqparent);
+ if (dialog.exec() == TQDialog::Rejected)
cancel();
if (linkContent->url().isEmpty() && linkContent->title().isEmpty())
setEmpty();
@@ -460,11 +460,11 @@ LinkEditor::LinkEditor(LinkContent *linkContent, QWidget *parent)
/** class LauncherEditor: */
-LauncherEditor::LauncherEditor(LauncherContent *launcherContent, QWidget *parent)
+LauncherEditor::LauncherEditor(LauncherContent *launcherContent, TQWidget *tqparent)
: NoteEditor(launcherContent)
{
- LauncherEditDialog dialog(launcherContent, parent);
- if (dialog.exec() == QDialog::Rejected)
+ LauncherEditDialog dialog(launcherContent, tqparent);
+ if (dialog.exec() == TQDialog::Rejected)
cancel();
if (launcherContent->name().isEmpty() && launcherContent->exec().isEmpty())
setEmpty();
@@ -472,13 +472,13 @@ LauncherEditor::LauncherEditor(LauncherContent *launcherContent, QWidget *parent
/** class ColorEditor: */
-ColorEditor::ColorEditor(ColorContent *colorContent, QWidget *parent)
+ColorEditor::ColorEditor(ColorContent *colorContent, TQWidget *tqparent)
: NoteEditor(colorContent)
{
- KColorDialog dialog(parent, /*name=*/"EditColor", /*modal=*/true);
+ KColorDialog dialog(tqparent, /*name=*/"EditColor", /*modal=*/true);
dialog.setColor(colorContent->color());
dialog.setCaption(i18n("Edit Color Note"));
- if (dialog.exec() == QDialog::Accepted) {
+ if (dialog.exec() == TQDialog::Accepted) {
if (dialog.color() != colorContent->color()) {
colorContent->setColor(dialog.color());
colorContent->setEdited();
@@ -487,8 +487,8 @@ ColorEditor::ColorEditor(ColorContent *colorContent, QWidget *parent)
cancel();
/* This code don't allow to set a caption to the dialog:
- QColor color = colorContent()->color();
- if (KColorDialog::getColor(color, parent) == QDialog::Accepted && color != m_color) {
+ TQColor color = colorContent()->color();
+ if (KColorDialog::getColor(color, tqparent) == TQDialog::Accepted && color != m_color) {
colorContent()->setColor(color);
setEdited();
}*/
@@ -496,10 +496,10 @@ ColorEditor::ColorEditor(ColorContent *colorContent, QWidget *parent)
/** class UnknownEditor: */
-UnknownEditor::UnknownEditor(UnknownContent *unknownContent, QWidget *parent)
+UnknownEditor::UnknownEditor(UnknownContent *unknownContent, TQWidget *tqparent)
: NoteEditor(unknownContent)
{
- KMessageBox::information(parent, i18n(
+ KMessageBox::information(tqparent, i18n(
"The type of this note is unknown and can not be edited here.\n"
"You however can drag or copy the note into an application that understands it."),
i18n("Edit Unknown Note"));
@@ -510,8 +510,8 @@ UnknownEditor::UnknownEditor(UnknownContent *unknownContent, QWidget *parent)
/** class DebuggedLineEdit: */
-DebuggedLineEdit::DebuggedLineEdit(const QString &text, QWidget *parent)
- : QLineEdit(text, parent)
+DebuggedLineEdit::DebuggedLineEdit(const TQString &text, TQWidget *tqparent)
+ : TQLineEdit(text, tqparent)
{
}
@@ -519,10 +519,10 @@ DebuggedLineEdit::~DebuggedLineEdit()
{
}
-void DebuggedLineEdit::keyPressEvent(QKeyEvent *event)
+void DebuggedLineEdit::keyPressEvent(TQKeyEvent *event)
{
- QString oldText = text();
- QLineEdit::keyPressEvent(event);
+ TQString oldText = text();
+ TQLineEdit::keyPressEvent(event);
if (oldText != text())
emit textChanged(text());
}
@@ -530,41 +530,41 @@ void DebuggedLineEdit::keyPressEvent(QKeyEvent *event)
/** class LinkEditDialog: */
-LinkEditDialog::LinkEditDialog(LinkContent *contentNote, QWidget *parent/*, QKeyEvent *ke*/)
+LinkEditDialog::LinkEditDialog(LinkContent *contentNote, TQWidget *tqparent/*, TQKeyEvent *ke*/)
: KDialogBase(KDialogBase::Plain, i18n("Edit Link Note"), KDialogBase::Ok | KDialogBase::Cancel,
- KDialogBase::Ok, parent, /*name=*/"EditLink", /*modal=*/true, /*separator=*/true),
+ KDialogBase::Ok, tqparent, /*name=*/"EditLink", /*modal=*/true, /*separator=*/true),
m_noteContent(contentNote)
{
- QWidget *page = plainPage();
- QGridLayout *layout = new QGridLayout(page, /*nRows=*/4, /*nCols=*/2, /*margin=*/0, spacingHint());
+ TQWidget *page = plainPage();
+ TQGridLayout *tqlayout = new TQGridLayout(page, /*nRows=*/4, /*nCols=*/2, /*margin=*/0, spacingHint());
m_url = new KURLRequester(m_noteContent->url().url(), page);
- QWidget *wid1 = new QWidget(page);
- QHBoxLayout *titleLay = new QHBoxLayout(wid1, /*margin=*/0, spacingHint());
+ TQWidget *wid1 = new TQWidget(page);
+ TQHBoxLayout *titleLay = new TQHBoxLayout(wid1, /*margin=*/0, spacingHint());
m_title = new DebuggedLineEdit(m_noteContent->title(), wid1);
- m_autoTitle = new QPushButton(i18n("Auto"), wid1);
+ m_autoTitle = new TQPushButton(i18n("Auto"), wid1);
m_autoTitle->setToggleButton(true);
m_autoTitle->setOn(m_noteContent->autoTitle());
titleLay->addWidget(m_title);
titleLay->addWidget(m_autoTitle);
- QWidget *wid = new QWidget(page);
- QHBoxLayout *hLay = new QHBoxLayout(wid, /*margin=*/0, spacingHint());
+ TQWidget *wid = new TQWidget(page);
+ TQHBoxLayout *hLay = new TQHBoxLayout(wid, /*margin=*/0, spacingHint());
m_icon = new KIconButton(wid);
- QLabel *label3 = new QLabel(m_icon, i18n("&Icon:"), page);
+ TQLabel *label3 = new TQLabel(m_icon, i18n("&Icon:"), page);
KURL filteredURL = NoteFactory::filteredURL(KURL(m_url->lineEdit()->text()));//KURIFilter::self()->filteredURI(KURL(m_url->lineEdit()->text()));
m_icon->setIconType(KIcon::NoGroup, KIcon::MimeType);
m_icon->setIconSize(LinkLook::lookForURL(filteredURL)->iconSize());
- m_autoIcon = new QPushButton(i18n("Auto"), wid); // Create before to know size here:
+ m_autoIcon = new TQPushButton(i18n("Auto"), wid); // Create before to know size here:
/* Icon button: */
m_icon->setIcon(m_noteContent->icon());
- int minSize = m_autoIcon->sizeHint().height();
- // Make the icon button at least the same heigh than the other buttons for a better alignment (nicer to the eyes):
- if (m_icon->sizeHint().height() < minSize)
+ int minSize = m_autoIcon->tqsizeHint().height();
+ // Make the icon button at least the same heigh than the other buttons for a better tqalignment (nicer to the eyes):
+ if (m_icon->tqsizeHint().height() < minSize)
m_icon->setFixedSize(minSize, minSize);
else
- m_icon->setFixedSize(m_icon->sizeHint().height(), m_icon->sizeHint().height()); // Make it square
+ m_icon->setFixedSize(m_icon->tqsizeHint().height(), m_icon->tqsizeHint().height()); // Make it square
/* Auto button: */
m_autoIcon->setToggleButton(true);
m_autoIcon->setOn(m_noteContent->autoIcon());
@@ -576,25 +576,25 @@ LinkEditDialog::LinkEditDialog(LinkContent *contentNote, QWidget *parent/*, QKey
m_title->setMinimumWidth(m_title->fontMetrics().maxWidth()*20);
//m_url->setShowLocalProtocol(true);
- QLabel *label1 = new QLabel(m_url, i18n("Ta&rget:"), page);
- QLabel *label2 = new QLabel(m_title, i18n("&Title:"), page);
- layout->addWidget(label1, 0, 0, Qt::AlignVCenter);
- layout->addWidget(label2, 1, 0, Qt::AlignVCenter);
- layout->addWidget(label3, 2, 0, Qt::AlignVCenter);
- layout->addWidget(m_url, 0, 1, Qt::AlignVCenter);
- layout->addWidget(wid1, 1, 1, Qt::AlignVCenter);
- layout->addWidget(wid, 2, 1, Qt::AlignVCenter);
+ TQLabel *label1 = new TQLabel(m_url, i18n("Ta&rget:"), page);
+ TQLabel *label2 = new TQLabel(m_title, i18n("&Title:"), page);
+ tqlayout->addWidget(label1, 0, 0, TQt::AlignVCenter);
+ tqlayout->addWidget(label2, 1, 0, TQt::AlignVCenter);
+ tqlayout->addWidget(label3, 2, 0, TQt::AlignVCenter);
+ tqlayout->addWidget(m_url, 0, 1, TQt::AlignVCenter);
+ tqlayout->addWidget(wid1, 1, 1, TQt::AlignVCenter);
+ tqlayout->addWidget(wid, 2, 1, TQt::AlignVCenter);
m_isAutoModified = false;
- connect( m_url, SIGNAL(textChanged(const QString&)), this, SLOT(urlChanged(const QString&)) );
- connect( m_title, SIGNAL(textChanged(const QString&)), this, SLOT(doNotAutoTitle(const QString&)) );
- connect( m_icon, SIGNAL(iconChanged(QString)) , this, SLOT(doNotAutoIcon(QString)) );
- connect( m_autoTitle, SIGNAL(clicked()), this, SLOT(guessTitle()) );
- connect( m_autoIcon, SIGNAL(clicked()), this, SLOT(guessIcon()) );
+ connect( m_url, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(urlChanged(const TQString&)) );
+ connect( m_title, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(doNotAutoTitle(const TQString&)) );
+ connect( m_icon, TQT_SIGNAL(iconChanged(TQString)) , this, TQT_SLOT(doNotAutoIcon(TQString)) );
+ connect( m_autoTitle, TQT_SIGNAL(clicked()), this, TQT_SLOT(guessTitle()) );
+ connect( m_autoIcon, TQT_SIGNAL(clicked()), this, TQT_SLOT(guessIcon()) );
- QWidget *stretchWidget = new QWidget(page);
- stretchWidget->setSizePolicy(QSizePolicy(/*hor=*/QSizePolicy::Fixed, /*ver=*/QSizePolicy::Expanding, /*hStretch=*/1, /*vStretch=*/255)); // Make it fill ALL vertical space
- layout->addWidget(stretchWidget, 3, 1, Qt::AlignVCenter);
+ TQWidget *stretchWidget = new TQWidget(page);
+ stretchWidget->tqsetSizePolicy(TQSizePolicy(/*hor=*/TQSizePolicy::Fixed, /*ver=*/TQSizePolicy::Expanding, /*hStretch=*/1, /*vStretch=*/255)); // Make it fill ALL vertical space
+ tqlayout->addWidget(stretchWidget, 3, 1, TQt::AlignVCenter);
urlChanged("");
@@ -620,7 +620,7 @@ void LinkEditDialog::polish()
}
-void LinkEditDialog::urlChanged(const QString&)
+void LinkEditDialog::urlChanged(const TQString&)
{
m_isAutoModified = true;
// guessTitle();
@@ -635,7 +635,7 @@ void LinkEditDialog::urlChanged(const QString&)
}
}
-void LinkEditDialog::doNotAutoTitle(const QString&)
+void LinkEditDialog::doNotAutoTitle(const TQString&)
{
if (m_isAutoModified)
m_isAutoModified = false;
@@ -643,7 +643,7 @@ void LinkEditDialog::doNotAutoTitle(const QString&)
m_autoTitle->setOn(false);
}
-void LinkEditDialog::doNotAutoIcon(QString)
+void LinkEditDialog::doNotAutoIcon(TQString)
{
m_autoIcon->setOn(false);
}
@@ -673,50 +673,50 @@ void LinkEditDialog::slotOk()
/* Change icon size if link look have changed */
LinkLook *linkLook = LinkLook::lookForURL(filteredURL);
- QString icon = m_icon->icon(); // When we change size, icon isn't changed and keep it's old size
- m_icon->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); // Reset size policy
+ TQString icon = m_icon->icon(); // When we change size, icon isn't changed and keep it's old size
+ m_icon->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); // Reset size policy
m_icon->setIconSize(linkLook->iconSize()); // So I store it's name and reload it after size change !
m_icon->setIcon(icon);
- int minSize = m_autoIcon->sizeHint().height();
- // Make the icon button at least the same heigh than the other buttons for a better alignment (nicer to the eyes):
- if (m_icon->sizeHint().height() < minSize)
+ int minSize = m_autoIcon->tqsizeHint().height();
+ // Make the icon button at least the same heigh than the other buttons for a better tqalignment (nicer to the eyes):
+ if (m_icon->tqsizeHint().height() < minSize)
m_icon->setFixedSize(minSize, minSize);
else
- m_icon->setFixedSize(m_icon->sizeHint().height(), m_icon->sizeHint().height()); // Make it square
+ m_icon->setFixedSize(m_icon->tqsizeHint().height(), m_icon->tqsizeHint().height()); // Make it square
KDialogBase::slotOk();
}
/** class LauncherEditDialog: */
-LauncherEditDialog::LauncherEditDialog(LauncherContent *contentNote, QWidget *parent)
+LauncherEditDialog::LauncherEditDialog(LauncherContent *contentNote, TQWidget *tqparent)
: KDialogBase(KDialogBase::Plain, i18n("Edit Launcher Note"), KDialogBase::Ok | KDialogBase::Cancel,
- KDialogBase::Ok, parent, /*name=*/"EditLauncher", /*modal=*/true, /*separator=*/true),
+ KDialogBase::Ok, tqparent, /*name=*/"EditLauncher", /*modal=*/true, /*separator=*/true),
m_noteContent(contentNote)
{
- QWidget *page = plainPage();
- QGridLayout *layout = new QGridLayout(page, /*nRows=*/4, /*nCols=*/2, /*margin=*/0, spacingHint());
+ TQWidget *page = plainPage();
+ TQGridLayout *tqlayout = new TQGridLayout(page, /*nRows=*/4, /*nCols=*/2, /*margin=*/0, spacingHint());
KService service(contentNote->fullPath());
m_command = new RunCommandRequester(service.exec(), i18n("Choose a command to run:"), page);
- m_name = new QLineEdit(service.name(), page);
+ m_name = new TQLineEdit(service.name(), page);
- QWidget *wid = new QWidget(page);
- QHBoxLayout *hLay = new QHBoxLayout(wid, /*margin=*/0, spacingHint());
+ TQWidget *wid = new TQWidget(page);
+ TQHBoxLayout *hLay = new TQHBoxLayout(wid, /*margin=*/0, spacingHint());
m_icon = new KIconButton(wid);
- QLabel *label = new QLabel(m_icon, i18n("&Icon:"), page);
+ TQLabel *label = new TQLabel(m_icon, i18n("&Icon:"), page);
m_icon->setIconType(KIcon::NoGroup, KIcon::Application);
m_icon->setIconSize(LinkLook::launcherLook->iconSize());
- QPushButton *guessButton = new QPushButton(i18n("&Guess"), wid);
+ TQPushButton *guessButton = new TQPushButton(i18n("&Guess"), wid);
/* Icon button: */
m_icon->setIcon(service.icon());
- int minSize = guessButton->sizeHint().height();
- // Make the icon button at least the same heigh than the other buttons for a better alignment (nicer to the eyes):
- if (m_icon->sizeHint().height() < minSize)
+ int minSize = guessButton->tqsizeHint().height();
+ // Make the icon button at least the same heigh than the other buttons for a better tqalignment (nicer to the eyes):
+ if (m_icon->tqsizeHint().height() < minSize)
m_icon->setFixedSize(minSize, minSize);
else
- m_icon->setFixedSize(m_icon->sizeHint().height(), m_icon->sizeHint().height()); // Make it square
+ m_icon->setFixedSize(m_icon->tqsizeHint().height(), m_icon->tqsizeHint().height()); // Make it square
/* Guess button: */
hLay->addWidget(m_icon);
hLay->addWidget(guessButton);
@@ -724,20 +724,20 @@ LauncherEditDialog::LauncherEditDialog(LauncherContent *contentNote, QWidget *pa
m_command->lineEdit()->setMinimumWidth(m_command->lineEdit()->fontMetrics().maxWidth()*20);
- QLabel *label1 = new QLabel(m_command->lineEdit(), i18n("Comman&d:"), page);
- QLabel *label2 = new QLabel(m_name, i18n("&Name:"), page);
- layout->addWidget(label1, 0, 0, Qt::AlignVCenter);
- layout->addWidget(label2, 1, 0, Qt::AlignVCenter);
- layout->addWidget(label, 2, 0, Qt::AlignVCenter);
- layout->addWidget(m_command, 0, 1, Qt::AlignVCenter);
- layout->addWidget(m_name, 1, 1, Qt::AlignVCenter);
- layout->addWidget(wid, 2, 1, Qt::AlignVCenter);
+ TQLabel *label1 = new TQLabel(m_command->lineEdit(), i18n("Comman&d:"), page);
+ TQLabel *label2 = new TQLabel(m_name, i18n("&Name:"), page);
+ tqlayout->addWidget(label1, 0, 0, TQt::AlignVCenter);
+ tqlayout->addWidget(label2, 1, 0, TQt::AlignVCenter);
+ tqlayout->addWidget(label, 2, 0, TQt::AlignVCenter);
+ tqlayout->addWidget(m_command, 0, 1, TQt::AlignVCenter);
+ tqlayout->addWidget(m_name, 1, 1, TQt::AlignVCenter);
+ tqlayout->addWidget(wid, 2, 1, TQt::AlignVCenter);
- QWidget *stretchWidget = new QWidget(page);
- stretchWidget->setSizePolicy(QSizePolicy(/*hor=*/QSizePolicy::Fixed, /*ver=*/QSizePolicy::Expanding, /*hStretch=*/1, /*vStretch=*/255)); // Make it fill ALL vertical space
- layout->addWidget(stretchWidget, 3, 1, Qt::AlignVCenter);
+ TQWidget *stretchWidget = new TQWidget(page);
+ stretchWidget->tqsetSizePolicy(TQSizePolicy(/*hor=*/TQSizePolicy::Fixed, /*ver=*/TQSizePolicy::Expanding, /*hStretch=*/1, /*vStretch=*/255)); // Make it fill ALL vertical space
+ tqlayout->addWidget(stretchWidget, 3, 1, TQt::AlignVCenter);
- connect( guessButton, SIGNAL(clicked()), this, SLOT(guessIcon()) );
+ connect( guessButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(guessIcon()) );
}
LauncherEditDialog::~LauncherEditDialog()
@@ -798,27 +798,27 @@ InlineEditors* InlineEditors::instance()
void InlineEditors::initToolBars(KActionCollection *actionCollection)
{
- QFont defaultFont;
- QColor textColor = (Global::bnpView && Global::bnpView->currentBasket() ?
+ TQFont defaultFont;
+ TQColor textColor = (Global::bnpView && Global::bnpView->currentBasket() ?
Global::bnpView->currentBasket()->textColor() :
KGlobalSettings::textColor());
// Init the RichTextEditor Toolbar:
richTextFont = new FocusedFontCombo(Global::mainWindow());
- richTextFont->setFixedWidth(richTextFont->sizeHint().width() * 2 / 3);
+ richTextFont->setFixedWidth(richTextFont->tqsizeHint().width() * 2 / 3);
richTextFont->setCurrentFont(defaultFont.family());
- KWidgetAction *action = new KWidgetAction(richTextFont, i18n("Font"), Qt::Key_F6,
+ KWidgetAction *action = new KWidgetAction(richTextFont, i18n("Font"), TQt::Key_F6,
/*receiver=*/0, /*slot=*/"", actionCollection, "richtext_font");
richTextFontSize = new FontSizeCombo(/*rw=*/true, Global::mainWindow());
richTextFontSize->setFontSize(defaultFont.pointSize());
- action = new KWidgetAction(richTextFontSize, i18n("Font Size"), Qt::Key_F7,
+ action = new KWidgetAction(richTextFontSize, i18n("Font Size"), TQt::Key_F7,
/*receiver=*/0, /*slot=*/"", actionCollection, "richtext_font_size");
richTextColor = new FocusedColorCombo(Global::mainWindow());
- richTextColor->setFixedWidth(richTextColor->sizeHint().height() * 2);
+ richTextColor->setFixedWidth(richTextColor->tqsizeHint().height() * 2);
richTextColor->setColor(textColor);
- action = new KWidgetAction(richTextColor, i18n("Color"), KShortcut(), 0, SLOT(), actionCollection, "richtext_color");
+ action = new KWidgetAction(richTextColor, i18n("Color"), KShortcut(), 0, TQT_SLOT(), actionCollection, "richtext_color");
richTextBold = new KToggleAction( i18n("Bold"), "text_bold", "Ctrl+B", actionCollection, "richtext_bold" );
richTextItalic = new KToggleAction( i18n("Italic"), "text_italic", "Ctrl+I", actionCollection, "richtext_italic" );
@@ -897,8 +897,8 @@ void InlineEditors::disableRichTextToolBar()
richTextRedo->setEnabled(false);
// Return to a "proper" state:
- QFont defaultFont;
- QColor textColor = (Global::bnpView && Global::bnpView->currentBasket() ?
+ TQFont defaultFont;
+ TQColor textColor = (Global::bnpView && Global::bnpView->currentBasket() ?
Global::bnpView->currentBasket()->textColor() :
KGlobalSettings::textColor());
richTextFont->setCurrentFont(defaultFont.family());