diff options
Diffstat (limited to 'src/common/gui/dialog.cpp')
-rw-r--r-- | src/common/gui/dialog.cpp | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/src/common/gui/dialog.cpp b/src/common/gui/dialog.cpp index 650b086..f8ee222 100644 --- a/src/common/gui/dialog.cpp +++ b/src/common/gui/dialog.cpp @@ -8,101 +8,101 @@ ***************************************************************************/ #include "dialog.h" -#include <qheader.h> -#include <qtimer.h> -#include <qlabel.h> -#include <qwidgetstack.h> +#include <tqheader.h> +#include <tqtimer.h> +#include <tqlabel.h> +#include <tqwidgetstack.h> #include <ktextedit.h> #include "misc_gui.h" //----------------------------------------------------------------------------- -Dialog::Dialog(QWidget *parent, const char *name, bool modal, - const QString &caption, int buttonMask, ButtonCode defaultButton, - bool separator, const QSize &defaultSize) - : KDialogBase(parent, name, modal, caption, buttonMask, defaultButton, separator), +Dialog::Dialog(TQWidget *tqparent, const char *name, bool modal, + const TQString &caption, int buttonMask, ButtonCode defaultButton, + bool separator, const TQSize &defaultSize) + : KDialogBase(tqparent, name, modal, caption, buttonMask, defaultButton, separator), _defaultSize(defaultSize) { - BusyCursor::start(); + PBusyCursor::start(); Q_ASSERT(name); - QWidget *main = new QWidget(this); + TQWidget *main = new TQWidget(this); setMainWidget(main); - QTimer::singleShot(0, this, SLOT(updateSize())); + TQTimer::singleShot(0, this, TQT_SLOT(updateSize())); } -Dialog::Dialog(DialogType type, const QString &caption, int buttonMask, ButtonCode defaultButton, - QWidget *parent, const char *name, bool modal, bool separator, const QSize &defaultSize) - : KDialogBase(type, caption, buttonMask, defaultButton, parent, name, modal, separator), +Dialog::Dialog(DialogType type, const TQString &caption, int buttonMask, ButtonCode defaultButton, + TQWidget *tqparent, const char *name, bool modal, bool separator, const TQSize &defaultSize) + : KDialogBase(type, caption, buttonMask, defaultButton, tqparent, name, modal, separator), _defaultSize(defaultSize) { - BusyCursor::start(); + PBusyCursor::start(); Q_ASSERT(name); - QTimer::singleShot(0, this, SLOT(updateSize())); + TQTimer::singleShot(0, this, TQT_SLOT(updateSize())); } Dialog::~Dialog() { GuiConfig gc; - gc.writeEntry(QString(name()) + "_size", size()); + gc.writeEntry(TQString(name()) + "_size", size()); } void Dialog::updateSize() { GuiConfig gc; - resize(gc.readSizeEntry(QString(name()) + "_size", &_defaultSize)); - BusyCursor::stop(); + resize(gc.readSizeEntry(TQString(name()) + "_size", &_defaultSize)); + PBusyCursor::stop(); } //----------------------------------------------------------------------------- -TreeListDialog::Item::Item(const QString &label, QWidget *page, const QString &title, QListView *listview) +TreeListDialog::Item::Item(const TQString &label, TQWidget *page, const TQString &title, TQListView *listview) : KListViewItem(listview, label), _page(page), _title(title) {} -TreeListDialog::Item::Item(const QString &label, QWidget *page, const QString &title, QListViewItem *item) +TreeListDialog::Item::Item(const TQString &label, TQWidget *page, const TQString &title, TQListViewItem *item) : KListViewItem(item, label), _page(page), _title(title) {} -TreeListDialog::TreeListDialog(QWidget *parent, const char *name, bool modal, - const QString &caption, int buttonMask, ButtonCode defaultButton, +TreeListDialog::TreeListDialog(TQWidget *tqparent, const char *name, bool modal, + const TQString &caption, int buttonMask, ButtonCode defaultButton, bool separator) - : Dialog(parent, name, modal, caption, buttonMask, defaultButton, separator) + : Dialog(tqparent, name, modal, caption, buttonMask, defaultButton, separator) { - QVBoxLayout *top = new QVBoxLayout(mainWidget(), 0, 10); + TQVBoxLayout *top = new TQVBoxLayout(mainWidget(), 0, 10); // list view - QValueList<int> widths; + TQValueList<int> widths; widths += 80; widths += 500; - Splitter *splitter = new Splitter(widths, Horizontal, mainWidget(), name); + Splitter *splitter = new Splitter(widths,Qt::Horizontal, mainWidget(), name); top->addWidget(splitter); _listView = new KListView(splitter); - connect(_listView, SIGNAL(currentChanged(QListViewItem *)), SLOT(currentChanged(QListViewItem *))); + connect(_listView, TQT_SIGNAL(currentChanged(TQListViewItem *)), TQT_SLOT(currentChanged(TQListViewItem *))); _listView->setAllColumnsShowFocus(true); _listView->setRootIsDecorated(true); _listView->setSorting(0); - _listView->addColumn(QString::null); + _listView->addColumn(TQString()); _listView->header()->hide(); - _listView->setResizeMode(QListView::LastColumn); + _listView->setResizeMode(TQListView::LastColumn); // pages - _frame = new QFrame(splitter); - QVBoxLayout *vbox = new QVBoxLayout(_frame, 10, 10); - _titleBox = new QHBoxLayout(vbox); - _label = new QLabel(_frame); + _frame = new TQFrame(splitter); + TQVBoxLayout *vbox = new TQVBoxLayout(_frame, 10, 10); + _titleBox = new TQHBoxLayout(vbox); + _label = new TQLabel(_frame); _titleBox->addWidget(_label); - _stack = new QWidgetStack(_frame); - connect(_stack, SIGNAL(aboutToShow(QWidget *)), SIGNAL(aboutToShowPage(QWidget *))); + _stack = new TQWidgetStack(_frame); + connect(_stack, TQT_SIGNAL(aboutToShow(TQWidget *)), TQT_SIGNAL(aboutToShowPage(TQWidget *))); vbox->addWidget(_stack); vbox->addStretch(1); } -QWidget *TreeListDialog::addPage(const QStringList &labels) +TQWidget *TreeListDialog::addPage(const TQStringList &labels) { Q_ASSERT( !labels.isEmpty() ); - QWidget *page = 0; - QListViewItem *item = 0; - QListViewItemIterator it(_listView); + TQWidget *page = 0; + TQListViewItem *item = 0; + TQListViewItemIterator it(_listView); for (; it.current(); ++it) { if ( it.current()->text(0)==labels[0] ) { item = it.current(); @@ -110,8 +110,8 @@ QWidget *TreeListDialog::addPage(const QStringList &labels) } } if ( item==0 ) { - page = new QWidget(_stack); - connect(page, SIGNAL(destroyed(QObject *)), SLOT(pageDestroyed(QObject *))); + page = new TQWidget(_stack); + connect(page, TQT_SIGNAL(destroyed(TQObject *)), TQT_SLOT(pageDestroyed(TQObject *))); _stack->addWidget(page); item = new Item(labels[0], page, labels[0], _listView); item->setOpen(true); @@ -119,9 +119,9 @@ QWidget *TreeListDialog::addPage(const QStringList &labels) item->setSelectable(last); } for (uint i=1; i<labels.count(); i++) { - QListViewItem *parent = item; + TQListViewItem *tqparent = item; item = 0; - QListViewItemIterator iti(parent); + TQListViewItemIterator iti(tqparent); for (; it.current(); ++it) { if ( it.current()->text(0)==labels[i] ) { item = it.current(); @@ -129,10 +129,10 @@ QWidget *TreeListDialog::addPage(const QStringList &labels) } } if ( item==0 ) { - page = new QWidget(_stack); - connect(page, SIGNAL(destroyed(QObject *)), SLOT(pageDestroyed(QObject *))); + page = new TQWidget(_stack); + connect(page, TQT_SIGNAL(destroyed(TQObject *)), TQT_SLOT(pageDestroyed(TQObject *))); _stack->addWidget(page); - item = new Item(labels[i], page, labels[i], parent); + item = new Item(labels[i], page, labels[i], tqparent); item->setOpen(true); bool last = ( labels.count()==i+1 ); item->setSelectable(last); @@ -142,7 +142,7 @@ QWidget *TreeListDialog::addPage(const QStringList &labels) return page; } -void TreeListDialog::currentChanged(QListViewItem *lvitem) +void TreeListDialog::currentChanged(TQListViewItem *lvitem) { if ( lvitem==0 ) return; Item *item = static_cast<Item *>(lvitem); @@ -151,9 +151,9 @@ void TreeListDialog::currentChanged(QListViewItem *lvitem) _stack->raiseWidget(item->_page); } -void TreeListDialog::showPage(QWidget *page) +void TreeListDialog::showPage(TQWidget *page) { - QListViewItemIterator it(_listView); + TQListViewItemIterator it(_listView); for (; it.current(); ++it) { Item *item = static_cast<Item *>(it.current()); if ( item->_page==page ) { @@ -164,7 +164,7 @@ void TreeListDialog::showPage(QWidget *page) } } -int TreeListDialog::pageIndex(QWidget *page) const +int TreeListDialog::pageIndex(TQWidget *page) const { return _stack->id(page); } @@ -176,24 +176,24 @@ int TreeListDialog::activePageIndex() const return pageIndex(item->_page); } -void TreeListDialog::pageDestroyed(QObject *object) +void TreeListDialog::pageDestroyed(TQObject *object) { - QListViewItemIterator it(_listView); + TQListViewItemIterator it(_listView); for (; it.current(); ++it) { Item *item = static_cast<Item *>(it.current()); - if ( item->_page!=object ) continue; + if ( TQT_BASE_OBJECT(item->_page)!=TQT_BASE_OBJECT(object) ) continue; delete item; break; } } //----------------------------------------------------------------------------- -TextEditorDialog::TextEditorDialog(const QString &text, const QString &caption, - bool wrapAtWidgetWidth, QWidget *parent) - : Dialog(parent, "text_editor_dialog", true, caption, Close, Close, false, QSize(200, 100)) +TextEditorDialog::TextEditorDialog(const TQString &text, const TQString &caption, + bool wrapAtWidgetWidth, TQWidget *tqparent) + : Dialog(tqparent, "text_editor_dialog", true, caption, Close, Close, false, TQSize(200, 100)) { - KTextEdit *w = new KTextEdit(text, QString::null, this); + KTextEdit *w = new KTextEdit(text, TQString(), this); w->setReadOnly(true); - w->setWordWrap(wrapAtWidgetWidth ? QTextEdit::WidgetWidth : QTextEdit::NoWrap); + w->setWordWrap(wrapAtWidgetWidth ? TQTextEdit::WidgetWidth : TQTextEdit::NoWrap); setMainWidget(w); } |