summaryrefslogtreecommitdiffstats
path: root/src/importdialog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
commit2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch)
tree18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/importdialog.cpp
parent1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff)
downloadtellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz
tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip
TQt4 port tellico
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/importdialog.cpp')
-rw-r--r--src/importdialog.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/src/importdialog.cpp b/src/importdialog.cpp
index 07e0ec1..9985902 100644
--- a/src/importdialog.cpp
+++ b/src/importdialog.cpp
@@ -38,36 +38,36 @@
#include <klocale.h>
#include <kstandarddirs.h>
-#include <qlayout.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qwhatsthis.h>
-#include <qtimer.h>
+#include <tqlayout.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqcheckbox.h>
+#include <tqwhatsthis.h>
+#include <tqtimer.h>
// really according to taste or computer speed
const unsigned Tellico::Import::Importer::s_stepSize = 20;
using Tellico::ImportDialog;
-ImportDialog::ImportDialog(Import::Format format_, const KURL::List& urls_, QWidget* parent_, const char* name_)
- : KDialogBase(parent_, name_, true /*modal*/, i18n("Import Options"), Ok|Cancel),
+ImportDialog::ImportDialog(Import::Format format_, const KURL::List& urls_, TQWidget* tqparent_, const char* name_)
+ : KDialogBase(tqparent_, name_, true /*modal*/, i18n("Import Options"), Ok|Cancel),
m_coll(0),
m_importer(importer(format_, urls_)) {
- QWidget* widget = new QWidget(this);
- QVBoxLayout* topLayout = new QVBoxLayout(widget, 0, spacingHint());
+ TQWidget* widget = new TQWidget(this);
+ TQVBoxLayout* topLayout = new TQVBoxLayout(widget, 0, spacingHint());
- QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, i18n("Import Options"), widget);
+ TQButtonGroup* bg = new TQButtonGroup(1, Qt::Horizontal, i18n("Import Options"), widget);
topLayout->addWidget(bg, 0);
- m_radioReplace = new QRadioButton(i18n("&Replace current collection"), bg);
- QWhatsThis::add(m_radioReplace, i18n("Replace the current collection with the contents "
+ m_radioReplace = new TQRadioButton(i18n("&Replace current collection"), bg);
+ TQWhatsThis::add(m_radioReplace, i18n("Replace the current collection with the contents "
"of the imported file."));
- m_radioAppend = new QRadioButton(i18n("A&ppend to current collection"), bg);
- QWhatsThis::add(m_radioAppend, i18n("Append the contents of the imported file to the "
+ m_radioAppend = new TQRadioButton(i18n("A&ppend to current collection"), bg);
+ TQWhatsThis::add(m_radioAppend, i18n("Append the contents of the imported file to the "
"current collection. This is only possible when the "
"collection types match."));
- m_radioMerge = new QRadioButton(i18n("&Merge with current collection"), bg);
- QWhatsThis::add(m_radioMerge, i18n("Merge the contents of the imported file to the "
+ m_radioMerge = new TQRadioButton(i18n("&Merge with current collection"), bg);
+ TQWhatsThis::add(m_radioMerge, i18n("Merge the contents of the imported file to the "
"current collection. This is only possible when the "
"collection types match. Entries must match exactly "
"in order to be merged."));
@@ -80,13 +80,13 @@ ImportDialog::ImportDialog(Import::Format format_, const KURL::List& urls_, QWid
m_radioMerge->setEnabled(false);
}
- QWidget* w = m_importer->widget(widget, "importer_widget");
+ TQWidget* w = m_importer->widget(widget, "importer_widget");
// m_importer->readOptions(KGlobal::config());
if(w) {
topLayout->addWidget(w, 0);
}
- connect(bg, SIGNAL(clicked(int)), m_importer, SLOT(slotActionChanged(int)));
+ connect(bg, TQT_SIGNAL(clicked(int)), m_importer, TQT_SLOT(slotActionChanged(int)));
topLayout->addStretch();
setMainWidget(widget);
@@ -96,8 +96,8 @@ ImportDialog::ImportDialog(Import::Format format_, const KURL::List& urls_, QWid
setButtonOK(ok);
// want to grab default button action, too
- // since the importer might do something with widgets, don't just call it, do it after layout is done
- QTimer::singleShot(0, this, SLOT(slotUpdateAction()));
+ // since the importer might do something with widgets, don't just call it, do it after tqlayout is done
+ TQTimer::singleShot(0, this, TQT_SLOT(slotUpdateAction()));
}
ImportDialog::~ImportDialog() {
@@ -112,8 +112,8 @@ Tellico::Data::CollPtr ImportDialog::collection() {
return m_coll;
}
-QString ImportDialog::statusMessage() const {
- return m_importer ? m_importer->statusMessage() : QString::null;
+TQString ImportDialog::statusMessage() const {
+ return m_importer ? m_importer->statusMessage() : TQString();
}
Tellico::Import::Action ImportDialog::action() const {
@@ -160,7 +160,7 @@ Tellico::Import::Importer* ImportDialog::importer(Import::Format format_, const
CHECK_SIZE;
importer = new Import::XSLTImporter(firstURL);
{
- QString xsltFile = locate("appdata", QString::fromLatin1("mods2tellico.xsl"));
+ TQString xsltFile = locate("appdata", TQString::tqfromLatin1("mods2tellico.xsl"));
if(!xsltFile.isEmpty()) {
KURL u;
u.setPath(xsltFile);
@@ -237,51 +237,51 @@ Tellico::Import::Importer* ImportDialog::importer(Import::Format format_, const
}
// static
-QString ImportDialog::fileFilter(Import::Format format_) {
- QString text;
+TQString ImportDialog::fileFilter(Import::Format format_) {
+ TQString text;
switch(format_) {
case Import::TellicoXML:
- text = i18n("*.tc *.bc|Tellico Files (*.tc)") + QChar('\n');
- text += i18n("*.xml|XML Files (*.xml)") + QChar('\n');
+ text = i18n("*.tc *.bc|Tellico Files (*.tc)") + TQChar('\n');
+ text += i18n("*.xml|XML Files (*.xml)") + TQChar('\n');
break;
case Import::Bibtex:
- text = i18n("*.bib|Bibtex Files (*.bib)") + QChar('\n');
+ text = i18n("*.bib|Bibtex Files (*.bib)") + TQChar('\n');
break;
case Import::CSV:
- text = i18n("*.csv|CSV Files (*.csv)") + QChar('\n');
+ text = i18n("*.csv|CSV Files (*.csv)") + TQChar('\n');
break;
case Import::Bibtexml:
case Import::XSLT:
- text = i18n("*.xml|XML Files (*.xml)") + QChar('\n');
+ text = i18n("*.xml|XML Files (*.xml)") + TQChar('\n');
break;
case Import::MODS:
case Import::Delicious:
- text = i18n("*.xml|XML Files (*.xml)") + QChar('\n');
+ text = i18n("*.xml|XML Files (*.xml)") + TQChar('\n');
break;
case Import::RIS:
- text = i18n("*.ris|RIS Files (*.ris)") + QChar('\n');
+ text = i18n("*.ris|RIS Files (*.ris)") + TQChar('\n');
break;
case Import::GCfilms:
- text = i18n("*.gcs|GCstar Data Files (*.gcs)") + QChar('\n');
- text += i18n("*.gcf|GCfilms Data Files (*.gcf)") + QChar('\n');
+ text = i18n("*.gcs|GCstar Data Files (*.gcs)") + TQChar('\n');
+ text += i18n("*.gcf|GCfilms Data Files (*.gcf)") + TQChar('\n');
break;
case Import::AMC:
- text = i18n("*.amc|AMC Data Files (*.amc)") + QChar('\n');
+ text = i18n("*.amc|AMC Data Files (*.amc)") + TQChar('\n');
break;
case Import::PDF:
- text = i18n("*.pdf|PDF Files (*.pdf)") + QChar('\n');
+ text = i18n("*.pdf|PDF Files (*.pdf)") + TQChar('\n');
break;
case Import::Referencer:
- text = i18n("*.reflib|Referencer Files (*.reflib)") + QChar('\n');
+ text = i18n("*.reflib|Referencer Files (*.reflib)") + TQChar('\n');
break;
case Import::AudioFile:
@@ -318,18 +318,18 @@ Tellico::Import::FormatMap ImportDialog::formatMap() {
// I decided they were likely to be the same in any language
// transliteration is unlikely
Import::FormatMap map;
- map[Import::TellicoXML] = QString::fromLatin1("Tellico");
- map[Import::Bibtex] = QString::fromLatin1("Bibtex");
- map[Import::Bibtexml] = QString::fromLatin1("Bibtexml");
-// map[Import::CSV] = QString::fromLatin1("CSV");
- map[Import::MODS] = QString::fromLatin1("MODS");
- map[Import::RIS] = QString::fromLatin1("RIS");
- map[Import::GCfilms] = QString::fromLatin1("GCstar");
- map[Import::AMC] = QString::fromLatin1("AMC");
- map[Import::Griffith] = QString::fromLatin1("Griffith");
- map[Import::PDF] = QString::fromLatin1("PDF");
- map[Import::Referencer] = QString::fromLatin1("Referencer");
- map[Import::Delicious ] = QString::fromLatin1("Delicious Library");
+ map[Import::TellicoXML] = TQString::tqfromLatin1("Tellico");
+ map[Import::Bibtex] = TQString::tqfromLatin1("Bibtex");
+ map[Import::Bibtexml] = TQString::tqfromLatin1("Bibtexml");
+// map[Import::CSV] = TQString::tqfromLatin1("CSV");
+ map[Import::MODS] = TQString::tqfromLatin1("MODS");
+ map[Import::RIS] = TQString::tqfromLatin1("RIS");
+ map[Import::GCfilms] = TQString::tqfromLatin1("GCstar");
+ map[Import::AMC] = TQString::tqfromLatin1("AMC");
+ map[Import::Griffith] = TQString::tqfromLatin1("Griffith");
+ map[Import::PDF] = TQString::tqfromLatin1("PDF");
+ map[Import::Referencer] = TQString::tqfromLatin1("Referencer");
+ map[Import::Delicious ] = TQString::tqfromLatin1("Delicious Library");
return map;
}
@@ -339,15 +339,15 @@ bool ImportDialog::formatImportsText(Import::Format format_) {
format_ != Import::PDF;
}
-QString ImportDialog::startDir(Import::Format format_) {
+TQString ImportDialog::startDir(Import::Format format_) {
if(format_ == Import::GCfilms) {
- QDir dir = QDir::home();
+ TQDir dir = TQDir::home();
// able to cd if exists and readable
- if(dir.cd(QString::fromLatin1(".local/share/gcfilms/"))) {
+ if(dir.cd(TQString::tqfromLatin1(".local/share/gcfilms/"))) {
return dir.absPath();
}
}
- return QString::fromLatin1(":import");
+ return TQString::tqfromLatin1(":import");
}
void ImportDialog::slotOk() {
@@ -362,8 +362,8 @@ void ImportDialog::slotOk() {
void ImportDialog::slotUpdateAction() {
// distasteful hack
// selectedId() is new in QT 3.2
-// m_importer->slotActionChanged(dynamic_cast<QButtonGroup*>(m_radioAppend->parentWidget())->selectedId());
- QButtonGroup* bg = static_cast<QButtonGroup*>(m_radioAppend->parentWidget());
+// m_importer->slotActionChanged(dynamic_cast<TQButtonGroup*>(m_radioAppend->tqparentWidget())->selectedId());
+ TQButtonGroup* bg = static_cast<TQButtonGroup*>(m_radioAppend->tqparentWidget());
m_importer->slotActionChanged(bg->id(bg->selected()));
}