From c663b6440964f6ac48027143ac9e63298991f9d0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:33:34 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kate/app/katesavemodifieddialog.cpp | 62 ++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'kate/app/katesavemodifieddialog.cpp') diff --git a/kate/app/katesavemodifieddialog.cpp b/kate/app/katesavemodifieddialog.cpp index 51dc1ea61..09257300c 100644 --- a/kate/app/katesavemodifieddialog.cpp +++ b/kate/app/katesavemodifieddialog.cpp @@ -20,30 +20,30 @@ #include "katesavemodifieddialog.moc" #include -#include +#include #include #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include #include #include -class AbstractKateSaveModifiedDialogCheckListItem:public QCheckListItem { +class AbstractKateSaveModifiedDialogCheckListItem:public TQCheckListItem { public: - AbstractKateSaveModifiedDialogCheckListItem(QListViewItem *parent,const QString& title, const QString& url):QCheckListItem(parent,title,QCheckListItem::CheckBox) { + AbstractKateSaveModifiedDialogCheckListItem(TQListViewItem *parent,const TQString& title, const TQString& url):TQCheckListItem(parent,title,TQCheckListItem::CheckBox) { setText(1,url); setOn(true); setState(InitialState); } virtual ~AbstractKateSaveModifiedDialogCheckListItem() { } - virtual bool synchronousSave(QWidget *dialogParent)=0; + virtual bool synchronousSave(TQWidget *dialogParent)=0; enum STATE{InitialState,SaveOKState,SaveFailedState}; STATE state() const { return m_state;} void setState(enum STATE state) { @@ -51,7 +51,7 @@ public: KIconLoader *loader = KGlobal::instance()->iconLoader(); switch (state) { case InitialState: - setPixmap(0,QPixmap()); + setPixmap(0,TQPixmap()); break; case SaveOKState: setPixmap(0,loader->loadIcon("ok",KIcon::NoGroup,height())); @@ -67,15 +67,15 @@ private: class KateSaveModifiedDocumentCheckListItem:public AbstractKateSaveModifiedDialogCheckListItem { public: - KateSaveModifiedDocumentCheckListItem(QListViewItem *parent,Kate::Document *document):AbstractKateSaveModifiedDialogCheckListItem(parent,document->docName(),document->url().prettyURL()){ + KateSaveModifiedDocumentCheckListItem(TQListViewItem *parent,Kate::Document *document):AbstractKateSaveModifiedDialogCheckListItem(parent,document->docName(),document->url().prettyURL()){ m_document=document; } virtual ~KateSaveModifiedDocumentCheckListItem() { } - virtual bool synchronousSave(QWidget *dialogParent) { + virtual bool synchronousSave(TQWidget *dialogParent) { if (m_document->url().isEmpty() ) { KEncodingFileDialog::Result r=KEncodingFileDialog::getSaveURLAndEncoding( - KTextEditor::encodingInterface(m_document)->encoding(),QString::null,QString::null,dialogParent,i18n("Save As (%1)").arg(m_document->docName())); + KTextEditor::encodingInterface(m_document)->encoding(),TQString::null,TQString::null,dialogParent,i18n("Save As (%1)").arg(m_document->docName())); m_document->setEncoding( r.encoding ); if (!r.URLs.isEmpty()) { @@ -125,7 +125,7 @@ private: Kate::Document *m_document; }; -KateSaveModifiedDialog::KateSaveModifiedDialog(QWidget *parent, QPtrList documents): +KateSaveModifiedDialog::KateSaveModifiedDialog(TQWidget *parent, TQPtrList documents): KDialogBase( parent, "KateSaveModifiedDialog", true, i18n("Save Documents"), Yes | No | Cancel) { KGuiItem saveItem=KStdGuiItem::save(); @@ -138,18 +138,18 @@ KateSaveModifiedDialog::KateSaveModifiedDialog(QWidget *parent, QPtrListThe following documents have been modified. Do you want to save them before closing?"),box); m_list=new KListView(box); m_list->addColumn(i18n("Title")); m_list->addColumn(i18n("Location")); m_list->setRootIsDecorated(true); - m_list->setResizeMode(QListView::LastColumn); + m_list->setResizeMode(TQListView::LastColumn); if (0) { - m_projectRoot=new QListViewItem(m_list,i18n("Projects")); + m_projectRoot=new TQListViewItem(m_list,i18n("Projects")); } else m_projectRoot=0; if (documents.count()>0) { - m_documentRoot=new QListViewItem(m_list,i18n("Documents")); + m_documentRoot=new TQListViewItem(m_list,i18n("Documents")); const uint docCnt=documents.count(); for (uint i=0;isetOpen(true); } else m_documentRoot=0; //FIXME - Is this the best way? - connect(m_list, SIGNAL(clicked(QListViewItem *)), SLOT(slotItemSelected())); - connect(m_list, SIGNAL(doubleClicked(QListViewItem *)), SLOT(slotItemSelected())); - connect(m_list, SIGNAL(spacePressed(QListViewItem *)), SLOT(slotItemSelected())); + connect(m_list, TQT_SIGNAL(clicked(TQListViewItem *)), TQT_SLOT(slotItemSelected())); + connect(m_list, TQT_SIGNAL(doubleClicked(TQListViewItem *)), TQT_SLOT(slotItemSelected())); + connect(m_list, TQT_SIGNAL(spacePressed(TQListViewItem *)), TQT_SLOT(slotItemSelected())); if(documents.count()>3) { //For 3 or less, it would be quicker just to tick or untick them yourself, so don't clutter the gui. - connect(new QPushButton(i18n("Se&lect All"),box),SIGNAL(clicked()),this,SLOT(slotSelectAll())); + connect(new TQPushButton(i18n("Se&lect All"),box),TQT_SIGNAL(clicked()),this,TQT_SLOT(slotSelectAll())); } } @@ -171,8 +171,8 @@ KateSaveModifiedDialog::~KateSaveModifiedDialog() { void KateSaveModifiedDialog::slotItemSelected() { kdDebug(13001) << "slotItemSelected()" << endl; - for(QListViewItem *it=m_documentRoot->firstChild();it;it=it->nextSibling()) { - if(((QCheckListItem*)it)->isOn()) { + for(TQListViewItem *it=m_documentRoot->firstChild();it;it=it->nextSibling()) { + if(((TQCheckListItem*)it)->isOn()) { enableButton(KDialogBase::Yes, true); return; } @@ -180,10 +180,10 @@ void KateSaveModifiedDialog::slotItemSelected() { enableButton(KDialogBase::Yes, false); } -static void selectItems(QListViewItem *root) { +static void selectItems(TQListViewItem *root) { if (!root) return; - for (QListViewItem *it=root->firstChild();it;it=it->nextSibling()) { - ((QCheckListItem*)it)->setOn(true); + for (TQListViewItem *it=root->firstChild();it;it=it->nextSibling()) { + ((TQCheckListItem*)it)->setOn(true); } } @@ -195,16 +195,16 @@ void KateSaveModifiedDialog::slotSelectAll() { void KateSaveModifiedDialog::slotUser2() { kdDebug(13001)<<"KateSaveModifiedDialog::slotYes()"<firstChild();it;it=it->nextSibling()) { + for (TQListViewItem *it=root->firstChild();it;it=it->nextSibling()) { AbstractKateSaveModifiedDialogCheckListItem *cit= (AbstractKateSaveModifiedDialogCheckListItem*)it; if (cit->isOn() && (cit->state()!=AbstractKateSaveModifiedDialogCheckListItem::SaveOKState)) { if (!cit->synchronousSave(this /*perhaps that should be the kate mainwindow*/)) { @@ -220,7 +220,7 @@ bool KateSaveModifiedDialog::doSave(QListViewItem *root) { return true; } -bool KateSaveModifiedDialog::queryClose(QWidget *parent,QPtrList documents) { +bool KateSaveModifiedDialog::queryClose(TQWidget *parent,TQPtrList documents) { KateSaveModifiedDialog d(parent,documents); - return (d.exec()!=QDialog::Rejected); + return (d.exec()!=TQDialog::Rejected); } -- cgit v1.2.1