diff options
Diffstat (limited to 'bibletime/frontend/cswordsetupdialog.cpp')
-rw-r--r-- | bibletime/frontend/cswordsetupdialog.cpp | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/bibletime/frontend/cswordsetupdialog.cpp b/bibletime/frontend/cswordsetupdialog.cpp index c02db6f..be9f459 100644 --- a/bibletime/frontend/cswordsetupdialog.cpp +++ b/bibletime/frontend/cswordsetupdialog.cpp @@ -55,8 +55,8 @@ using namespace sword; namespace BookshelfManager { - CSwordSetupDialog::CSwordSetupDialog(TQWidget *parent, const char *name ) -: KDialogBase(IconList, i18n("Bookshelf Manager"), Ok, Ok, parent, name, true, true, TQString::null, TQString::null, TQString::null), + CSwordSetupDialog::CSwordSetupDialog(TQWidget *tqparent, const char *name ) +: KDialogBase(IconList, i18n("Bookshelf Manager"), Ok, Ok, tqparent, name, true, true, TQString(), TQString(), TQString()), m_removeModuleListView(0), m_installModuleListPage(0), m_installModuleListView(0), @@ -72,73 +72,73 @@ namespace BookshelfManager { } void CSwordSetupDialog::initSwordConfig() { - TQFrame* page = m_swordConfigPage = addPage(i18n("Bookshelf path(s)"), TQString::null, SmallIcon("bt_swordconfig",32)); + TQFrame* page = m_swordConfigPage = addPage(i18n("Bookshelf path(s)"), TQString(), SmallIcon("bt_swordconfig",32)); page->setMinimumSize(500,400); - TQGridLayout* layout = new TQGridLayout(page, 6, 4); - layout->setMargin(5); + TQGridLayout* tqlayout = new TQGridLayout(page, 6, 4); + tqlayout->setMargin(5); - layout->setSpacing(10); - layout->setColStretch(0,1); - layout->setRowStretch(5,1); + tqlayout->setSpacing(10); + tqlayout->setColStretch(0,1); + tqlayout->setRowStretch(5,1); TQLabel* mainLabel = CToolClass::explanationLabel(page, i18n("Configure bookshelf path(s)"), i18n("You can store your bookshelfs in one or more directories, which you can specify here.") ); - layout->addMultiCellWidget(mainLabel, 0, 0, 0, 3); + tqlayout->addMultiCellWidget(mainLabel, 0, 0, 0, 3); TQString swordConfPath = BTInstallMgr::Tool::LocalConfig::swordConfigFilename(); - TQLabel* confPathLabel = new TQLabel(i18n("Your bookshelf configuration file is <b>%1</b>").arg(swordConfPath), page); - layout->addMultiCellWidget(confPathLabel, 1,1,0,3); + TQLabel* confPathLabel = new TQLabel(i18n("Your bookshelf configuration file is <b>%1</b>").tqarg(swordConfPath), page); + tqlayout->addMultiCellWidget(confPathLabel, 1,1,0,3); m_swordPathListBox = new TQListView(page); // m_swordPathListBox->setFullWidth(true); m_swordPathListBox->addColumn(i18n("Path to bookshelf")); connect(m_swordPathListBox, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slot_swordPathSelected())); - layout->addMultiCellWidget(m_swordPathListBox, 2,5,0,1); + tqlayout->addMultiCellWidget(m_swordPathListBox, 2,5,0,1); m_swordEditPathButton = new TQPushButton(i18n("Edit Entry"), page); m_swordEditPathButton->setIconSet(SmallIcon("edit", 16)); connect(m_swordEditPathButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slot_swordEditClicked())); - layout->addWidget(m_swordEditPathButton, 2, 3); + tqlayout->addWidget(m_swordEditPathButton, 2, 3); m_swordAddPathButton = new TQPushButton(i18n("Add Entry"), page); m_swordAddPathButton->setIconSet(SmallIcon("edit_add", 16)); connect(m_swordAddPathButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slot_swordAddClicked())); - layout->addWidget(m_swordAddPathButton, 3,3); + tqlayout->addWidget(m_swordAddPathButton, 3,3); m_swordRemovePathButton = new TQPushButton(i18n("Remove Entry"), page); m_swordRemovePathButton->setIconSet(SmallIcon("editdelete", 16)); connect(m_swordRemovePathButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slot_swordRemoveClicked())); - layout->addWidget(m_swordRemovePathButton, 4,3); + tqlayout->addWidget(m_swordRemovePathButton, 4,3); setupSwordPathListBox(); } void CSwordSetupDialog::initInstall() { - m_installPage = addPage(i18n("Install/Update works"), TQString::null, SmallIcon("bt_bible",32)); + m_installPage = addPage(i18n("Install/Update works"), TQString(), SmallIcon("bt_bible",32)); - TQVBoxLayout* vboxlayout = new TQVBoxLayout(m_installPage); - TQHBoxLayout* hboxlayout = new TQHBoxLayout(); - hboxlayout->setAutoAdd( true ); + TQVBoxLayout* vboxtqlayout = new TQVBoxLayout(m_installPage); + TQHBoxLayout* hboxtqlayout = new TQHBoxLayout(); + hboxtqlayout->setAutoAdd( true ); - vboxlayout->addLayout(hboxlayout); + vboxtqlayout->addLayout(hboxtqlayout); m_installWidgetStack = new TQWidgetStack(m_installPage); - hboxlayout->addWidget(m_installWidgetStack); + hboxtqlayout->addWidget(m_installWidgetStack); m_installSourcePage = new TQWidget(0); m_installWidgetStack->addWidget(m_installSourcePage); // m_installSourcePage->setMinimumSize(500,400); - TQGridLayout* layout = new TQGridLayout(m_installSourcePage, 7, 3); - layout->setMargin(5); - layout->setSpacing(10); - layout->setRowStretch(6,5); - layout->setColStretch(0,5); + TQGridLayout* tqlayout = new TQGridLayout(m_installSourcePage, 7, 3); + tqlayout->setMargin(5); + tqlayout->setSpacing(10); + tqlayout->setRowStretch(6,5); + tqlayout->setColStretch(0,5); TQLabel* installLabel = CToolClass::explanationLabel(m_installSourcePage, i18n("Install/update works - Step 1"), @@ -147,39 +147,39 @@ After that step click on the connect button.<br/>\ <b>WARNING: If you live in a persecuted country and do not wish to risk detection you should NOT use \ the module remote installation feature!</b>") ); - layout->addMultiCellWidget(installLabel, 0,0,0,2); + tqlayout->addMultiCellWidget(installLabel, 0,0,0,2); - TQLabel* sourceHeadingLabel = new TQLabel(TQString("<b>%1</b>").arg(i18n("Select library")), m_installSourcePage); - layout->addMultiCellWidget(sourceHeadingLabel, 1,1,0,1); + TQLabel* sourceHeadingLabel = new TQLabel(TQString("<b>%1</b>").tqarg(i18n("Select library")), m_installSourcePage); + tqlayout->addMultiCellWidget(sourceHeadingLabel, 1,1,0,1); m_sourceCombo = new TQComboBox(m_installSourcePage); - layout->addWidget(m_sourceCombo, 2, 0); + tqlayout->addWidget(m_sourceCombo, 2, 0); TQPushButton* deleteSourceButton = new TQPushButton(i18n("Delete library"), m_installSourcePage); deleteSourceButton->setIconSet(SmallIcon("remove", 16)); connect(deleteSourceButton, TQT_SIGNAL(clicked()), TQT_SLOT(slot_installDeleteSource())); - layout->addWidget(deleteSourceButton, 2, 1, Qt::AlignLeft); + tqlayout->addWidget(deleteSourceButton, 2, 1, TQt::AlignLeft); TQPushButton* addSourceButton = new TQPushButton(i18n("Add library"), m_installSourcePage); addSourceButton->setIconSet(SmallIcon("folder_new", 16)); connect(addSourceButton, TQT_SIGNAL(clicked()), TQT_SLOT(slot_installAddSource())); - layout->addWidget(addSourceButton, 2, 2, Qt::AlignLeft); + tqlayout->addWidget(addSourceButton, 2, 2, TQt::AlignLeft); m_sourceLabel = new TQLabel(m_installSourcePage); - layout->addMultiCellWidget(m_sourceLabel, 3,3,0,1); + tqlayout->addMultiCellWidget(m_sourceLabel, 3,3,0,1); - TQLabel* targetHeadingLabel = new TQLabel(TQString("<b>%1</b>").arg(i18n("Select bookshelf path")), m_installSourcePage); - layout->addMultiCellWidget(targetHeadingLabel, 4,4,0,1); + TQLabel* targetHeadingLabel = new TQLabel(TQString("<b>%1</b>").tqarg(i18n("Select bookshelf path")), m_installSourcePage); + tqlayout->addMultiCellWidget(targetHeadingLabel, 4,4,0,1); m_targetCombo = new TQComboBox(m_installSourcePage); - layout->addWidget(m_targetCombo, 5, 0); + tqlayout->addWidget(m_targetCombo, 5, 0); m_targetLabel = new TQLabel(m_installSourcePage); - layout->addMultiCellWidget(m_targetLabel, 6,6,0,0,Qt::AlignTop); + tqlayout->addMultiCellWidget(m_targetLabel, 6,6,0,0,TQt::AlignTop); - //part beloew main layout with the back/next buttons + //part beloew main tqlayout with the back/next buttons TQHBoxLayout* myHBox = new TQHBoxLayout(); - vboxlayout->addLayout(myHBox); + vboxtqlayout->addLayout(myHBox); m_installBackButton = new TQPushButton(i18n("Back"), m_installPage); m_installBackButton->setIconSet(SmallIcon("back",16)); @@ -203,32 +203,32 @@ the module remote installation feature!</b>") } void CSwordSetupDialog::initRemove() { - TQFrame* page = m_removePage = addPage(i18n("Remove works"), TQString::null, SmallIcon("edittrash",32)); + TQFrame* page = m_removePage = addPage(i18n("Remove works"), TQString(), SmallIcon("edittrash",32)); page->setMinimumSize(500,400); - TQGridLayout* layout = new TQGridLayout(page, 4, 4); - layout->setMargin(5); + TQGridLayout* tqlayout = new TQGridLayout(page, 4, 4); + tqlayout->setMargin(5); - layout->setSpacing(10); - layout->setColStretch(1,1); - layout->setRowStretch(2,1); + tqlayout->setSpacing(10); + tqlayout->setColStretch(1,1); + tqlayout->setRowStretch(2,1); TQLabel* mainLabel= CToolClass::explanationLabel(page, i18n("Remove installed work(s)"), i18n("This dialog lets you remove installed works from your system. Choose the modules and then click on the remove button.") ); - layout->addMultiCellWidget(mainLabel, 0, 0, 0, 3); + tqlayout->addMultiCellWidget(mainLabel, 0, 0, 0, 3); - TQLabel* headingLabel = new TQLabel(TQString("<b>%1</b>").arg(i18n("Select works to be uninstalled")), page); - layout->addMultiCellWidget(headingLabel, 1, 1, 0, 3); + TQLabel* headingLabel = new TQLabel(TQString("<b>%1</b>").tqarg(i18n("Select works to be uninstalled")), page); + tqlayout->addMultiCellWidget(headingLabel, 1, 1, 0, 3); m_removeModuleListView = new CSwordSetupModuleListView(page, false); - layout->addMultiCellWidget( m_removeModuleListView, 2,2,0,3); + tqlayout->addMultiCellWidget( m_removeModuleListView, 2,2,0,3); m_removeRemoveButton = new TQPushButton(i18n("Remove selected work(s)"), page); m_removeRemoveButton->setIconSet( SmallIcon("edittrash", 16) ); - layout->addWidget(m_removeRemoveButton, 3, 3, Qt::AlignRight); + tqlayout->addWidget(m_removeRemoveButton, 3, 3, TQt::AlignRight); connect(m_removeRemoveButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slot_doRemoveModules())); @@ -239,7 +239,7 @@ the module remote installation feature!</b>") void CSwordSetupDialog::initManageIndices() { TQFrame* page = m_manageIndiciesPage = addPage(i18n("Manage search indicies"), - TQString::null, SmallIcon("filefind",32)); + TQString(), SmallIcon("filetqfind",32)); page->setMinimumSize(500,400); TQVBoxLayout* box = new TQVBoxLayout(page, 4, 4); @@ -364,12 +364,12 @@ the module remote installation feature!</b>") TQString source = sourceName; TQString rep = i18n("[Local]") + " "; - int i = source.find(rep); + int i = source.tqfind(rep); if (i>=0) { source.remove(i, rep.length()); } rep = i18n("[Remote]") + " "; - i = source.find(rep); + i = source.tqfind(rep); if (i>=0) { source.remove(i, rep.length()); } @@ -379,10 +379,10 @@ the module remote installation feature!</b>") sword::InstallSource is = BTInstallMgr::Tool::RemoteConfig::source(&mgr, source) ; if (BTInstallMgr::Tool::RemoteConfig::isRemoteSource(&is)) { - url = TQString("ftp://%1%2").arg(is.source.c_str()).arg(is.directory.c_str()); + url = TQString("ftp://%1%2").tqarg(is.source.c_str()).tqarg(is.directory.c_str()); } else { - url = TQString("%1").arg(is.directory.c_str()); + url = TQString("%1").tqarg(is.directory.c_str()); } m_sourceLabel->setText( url ); @@ -405,7 +405,7 @@ the module remote installation feature!</b>") } const TQString message = i18n("You selected the following work(s): %1.\n\n" - "Do you really want to remove them from your system?").arg(moduleList.join(", ")); + "Do you really want to remove them from your system?").tqarg(moduleList.join(", ")); if ((KMessageBox::warningYesNo(0, message, i18n("Warning")) == KMessageBox::Yes)) { //Yes was pressed. sword::InstallMgr installMgr; @@ -420,11 +420,11 @@ the module remote installation feature!</b>") dataPath = dataPath.mid(2); } - if (prefixPath.contains(dataPath)) { //remove module part to get the prefix path - prefixPath = prefixPath.remove( prefixPath.find(dataPath), dataPath.length() ); + if (prefixPath.tqcontains(dataPath)) { //remove module part to get the prefix path + prefixPath = prefixPath.remove( prefixPath.tqfind(dataPath), dataPath.length() ); } else { //fall back to default Sword config path - prefixPath = TQString::fromLatin1(backend()->prefixPath); + prefixPath = TQString::tqfromLatin1(backend()->prefixPath); } sword::SWMgr* mgr = mgrDict[ prefixPath ]; @@ -481,7 +481,7 @@ the module remote installation feature!</b>") sword::InstallSource is = BTInstallMgr::Tool::RemoteConfig::source(&iMgr, sourceName); bool success = false; - m_progressDialog = new KProgressDialog(this, 0, i18n("Download"), TQString::null, true); + m_progressDialog = new KProgressDialog(this, 0, i18n("Download"), TQString(), true); m_progressDialog->progressBar()->setTotalSteps(100); m_progressDialog->setLabel( i18n("Downloading library information...") ); m_progressDialog->setMinimumDuration(0); //show immediately @@ -601,7 +601,7 @@ the module remote installation feature!</b>") (*it), installedModule ? installedModule->config(CSwordModuleInfo::ModuleVersion) - : TQString::null + : TQString() ); } m_installModuleListView->finish(); @@ -612,16 +612,16 @@ the module remote installation feature!</b>") if (!m_installModuleListPage) { //the widgets are not yet created m_installModuleListPage = new TQWidget(0); - TQGridLayout* layout = new TQGridLayout(m_installModuleListPage, 7, 2); - layout->setMargin(5); - layout->setSpacing(10); + TQGridLayout* tqlayout = new TQGridLayout(m_installModuleListPage, 7, 2); + tqlayout->setMargin(5); + tqlayout->setSpacing(10); TQLabel* installLabel = CToolClass::explanationLabel(m_installModuleListPage, i18n("Install/update works - Step 2"), i18n("Please choose the works which should be installed and/or updated and click the install button.") ); - layout->addMultiCellWidget(installLabel, 0,0,0,1); - layout->setRowStretch(0,0); + tqlayout->addMultiCellWidget(installLabel, 0,0,0,1); + tqlayout->setRowStretch(0,0); m_installWidgetStack->addWidget(m_installModuleListPage); m_installModuleListPage->setMinimumSize(500,400); @@ -631,9 +631,9 @@ the module remote installation feature!</b>") sword::InstallSource is = BTInstallMgr::Tool::RemoteConfig::source(&iMgr, currentInstallSource()); m_installModuleListView = new CSwordSetupModuleListView(m_installModuleListPage, true, &is); - layout->addMultiCellWidget( m_installModuleListView, 1,6,0,1); - layout->setColStretch(0,5); - layout->setRowStretch(1,5); + tqlayout->addMultiCellWidget( m_installModuleListView, 1,6,0,1); + tqlayout->setColStretch(0,5); + tqlayout->setRowStretch(1,5); connect(m_installModuleListView, TQT_SIGNAL(selectedModulesChanged()), TQT_SLOT(slot_installModulesChanged())); } @@ -696,7 +696,7 @@ the module remote installation feature!</b>") } const TQString message = i18n("You selected the following works: %1.\n\n\ - Do you really want to install them on your system?").arg(moduleList.join(", ")); + Do you really want to install them on your system?").tqarg(moduleList.join(", ")); if ((KMessageBox::warningYesNo(0, message, i18n("Warning")) == KMessageBox::Yes)) { //Yes was pressed. BTInstallMgr iMgr; @@ -722,7 +722,7 @@ the module remote installation feature!</b>") //module are removed in this section of code m_installedModuleCount = 0; - m_progressDialog = new KProgressDialog(this, 0, i18n("Download of work(s)"), TQString::null, true); + m_progressDialog = new KProgressDialog(this, 0, i18n("Download of work(s)"), TQString(), true); m_progressDialog->progressBar()->setTotalSteps(100 * moduleList.count()); m_progressDialog->setMinimumDuration(0); //show immediately m_progressDialog->setAutoClose(false); @@ -753,12 +753,12 @@ the module remote installation feature!</b>") dataPath = dataPath.mid(2); } - if (prefixPath.contains(dataPath)) { - prefixPath.remove( prefixPath.find(dataPath), dataPath.length() ); //complicated to work with Qt 3.0 - //prefixPath = prefixPath.replace(dataPath, ""); //old code working with Qt 3.2 + if (prefixPath.tqcontains(dataPath)) { + prefixPath.remove( prefixPath.tqfind(dataPath), dataPath.length() ); //complicated to work with TQt 3.0 + //prefixPath = prefixPath.tqreplace(dataPath, ""); //old code working with TQt 3.2 } else { - prefixPath = TQString::fromLatin1(backend()->prefixPath); + prefixPath = TQString::tqfromLatin1(backend()->prefixPath); } sword::SWMgr mgr(prefixPath.latin1()); @@ -795,7 +795,7 @@ the module remote installation feature!</b>") void CSwordSetupDialog::installCompleted( const int total, const int /* file */) { if (m_progressDialog) { m_progressDialog->progressBar()->setProgress(total+100*m_installedModuleCount); - m_progressDialog->setLabel( i18n("[%1]: %2% complete").arg(m_installingModule).arg(total) ); + m_progressDialog->setLabel( i18n("[%1]: %2% complete").tqarg(m_installingModule).tqarg(total) ); } KApplication::kApplication()->processEvents(); } @@ -834,7 +834,7 @@ the module remote installation feature!</b>") } void CSwordSetupDialog::slot_swordAddClicked() { - KURL url = KDirSelectDialog::selectDirectory(TQString::null, true); + KURL url = KDirSelectDialog::selectDirectory(TQString(), true); if (url.isValid()) { const TQFileInfo fi( url.path() ); if (!fi.exists() || !fi.isWritable()) { @@ -885,12 +885,12 @@ the module remote installation feature!</b>") const TQString CSwordSetupDialog::currentInstallSource() { TQString source = m_sourceCombo->currentText(); TQString rep = i18n("[Local]") + " "; - int i = source.find(rep); + int i = source.tqfind(rep); if (i>=0) { source.remove(i, rep.length()); } rep = i18n("[Remote]") + " "; - i = source.find(rep); + i = source.tqfind(rep); if (i>=0) { source.remove(i, rep.length()); } |