summaryrefslogtreecommitdiffstats
path: root/kexi/main/startup/KexiStartup.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/main/startup/KexiStartup.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/main/startup/KexiStartup.cpp')
-rw-r--r--kexi/main/startup/KexiStartup.cpp216
1 files changed, 108 insertions, 108 deletions
diff --git a/kexi/main/startup/KexiStartup.cpp b/kexi/main/startup/KexiStartup.cpp
index 19ae8d28..54d977e4 100644
--- a/kexi/main/startup/KexiStartup.cpp
+++ b/kexi/main/startup/KexiStartup.cpp
@@ -18,7 +18,7 @@
*/
#include "KexiStartup.h"
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
# include "KexiStartup_p_win.h"
#else
# include "KexiStartup_p.h"
@@ -52,9 +52,9 @@
#include <unistd.h>
-#include <qcstring.h>
-#include <qapplication.h>
-#include <qlayout.h>
+#include <tqcstring.h>
+#include <tqapplication.h>
+#include <tqlayout.h>
namespace Kexi {
static KStaticDeleter<KexiStartupHandler> Kexi_startupHandlerDeleter;
@@ -92,13 +92,13 @@ class KexiStartupHandlerPrivate
KexiDBShortcutFile *shortcutFile;
KexiDBConnShortcutFile *connShortcutFile;
KexiDBConnectionDialog *connDialog;
- QString shortcutFileGroupKey;
+ TQString shortcutFileGroupKey;
KexiStartupDialog *startupDialog;
};
//---------------------------------
-static bool stripQuotes(const QString &item, QString &name)
+static bool stripQuotes(const TQString &item, TQString &name)
{
if (item.left(1)=="\"" && item.right(1)=="\"") {
name = item.mid(1, item.length()-2);
@@ -111,7 +111,7 @@ static bool stripQuotes(const QString &item, QString &name)
void updateProgressBar(KProgressDialog *pd, char *buffer, int buflen)
{
char *p = buffer;
- QCString line(80);
+ TQCString line(80);
for (int i=0; i<buflen; i++, p++) {
if ((i==0 || buffer[i-1]=='\n') && buffer[i]=='%') {
bool ok;
@@ -120,13 +120,13 @@ void updateProgressBar(KProgressDialog *pd, char *buffer, int buflen)
++i;
line="";
for (;i<buflen && *p>='0' && *p<='9'; j++, i++, p++)
- line+=QChar(*p);
+ line+=TQChar(*p).latin1();
--i; --p;
int percent = line.toInt(&ok);
if (ok && percent>=0 && percent<=100 && pd->progressBar()->progress()<percent) {
// kdDebug() << percent << endl;
pd->progressBar()->setProgress(percent);
- qApp->processEvents(100);
+ tqApp->tqprocessEvents(100);
}
}
}
@@ -134,36 +134,36 @@ void updateProgressBar(KProgressDialog *pd, char *buffer, int buflen)
//---------------------------------
-KexiDBPasswordDialog::KexiDBPasswordDialog(QWidget *parent, KexiDB::ConnectionData& cdata, bool showDetailsButton)
+KexiDBPasswordDialog::KexiDBPasswordDialog(TQWidget *tqparent, KexiDB::ConnectionData& cdata, bool showDetailsButton)
: KPasswordDialog( KPasswordDialog::Password, false/*keep*/,
- showDetailsButton ? (int)KDialogBase::User1 : 0, parent )
+ showDetailsButton ? (int)KDialogBase::User1 : 0, tqparent )
, m_cdata(&cdata)
, m_showConnectionDetailsRequested(false)
{
- QString msg = "<H2>" + i18n("Opening database") + "</H2><p>"
+ TQString msg = "<H2>" + i18n("Opening database") + "</H2><p>"
+ i18n("Please enter the password.") + "</p>";
/* msg += cdata.userName.isEmpty() ?
"<p>"+i18n("Please enter the password.")
- : "<p>"+i18n("Please enter the password for user.").arg("<b>"+cdata.userName+"</b>");*/
+ : "<p>"+i18n("Please enter the password for user.").tqarg("<b>"+cdata.userName+"</b>");*/
- QString srv = cdata.serverInfoString(false);
+ TQString srv = cdata.serverInfoString(false);
if (srv.isEmpty() || srv.lower()=="localhost")
srv = i18n("local database server");
- msg += ("</p><p>"+i18n("Database server: %1").arg(QString("<nobr>")+srv+"</nobr>")+"</p>");
+ msg += ("</p><p>"+i18n("Database server: %1").tqarg(TQString("<nobr>")+srv+"</nobr>")+"</p>");
- QString usr;
+ TQString usr;
if (cdata.userName.isEmpty())
usr = i18n("unspecified user", "(unspecified)");
else
usr = cdata.userName;
- msg += ("<p>"+i18n("Username: %1").arg(usr)+"</p>");
+ msg += ("<p>"+i18n("Username: %1").tqarg(usr)+"</p>");
setPrompt( msg );
if (showDetailsButton) {
- connect( this, SIGNAL(user1Clicked()),
- this, SLOT(slotShowConnectionDetails()) );
+ connect( this, TQT_SIGNAL(user1Clicked()),
+ this, TQT_SLOT(slotShowConnectionDetails()) );
setButtonText(KDialogBase::User1, i18n("&Details")+ " >>");
}
setButtonOK(KGuiItem(i18n("&Open"), "fileopen"));
@@ -175,10 +175,10 @@ KexiDBPasswordDialog::~KexiDBPasswordDialog()
void KexiDBPasswordDialog::done(int r)
{
- if (r == QDialog::Accepted) {
- m_cdata->password = QString::fromLatin1(password());
+ if (r == TQDialog::Accepted) {
+ m_cdata->password = TQString::tqfromLatin1(password());
}
-// if (d->showConnectionDetailsExecuted || ret == QDialog::Accepted) {
+// if (d->showConnectionDetailsExecuted || ret == TQDialog::Accepted) {
/* } else {
m_action = Exit;
return true;
@@ -195,7 +195,7 @@ void KexiDBPasswordDialog::slotShowConnectionDetails()
//---------------------------------
KexiStartupHandler::KexiStartupHandler()
- : QObject(0,"KexiStartupHandler")
+ : TQObject(0,"KexiStartupHandler")
, KexiStartupData()
, d( new KexiStartupHandlerPrivate() )
{
@@ -206,13 +206,13 @@ KexiStartupHandler::~KexiStartupHandler()
delete d;
}
-bool KexiStartupHandler::getAutoopenObjects(KCmdLineArgs *args, const QCString &action_name)
+bool KexiStartupHandler::getAutoopenObjects(KCmdLineArgs *args, const TQCString &action_name)
{
QCStringList list = args->getOptionList(action_name);
QCStringList::ConstIterator it;
bool atLeastOneFound = false;
for ( it = list.constBegin(); it!=list.constEnd(); ++it) {
- QString type_name, obj_name, item=*it;
+ TQString type_name, obj_name, item=*it;
int idx;
bool name_required = true;
if (action_name=="new") {
@@ -221,7 +221,7 @@ bool KexiStartupHandler::getAutoopenObjects(KCmdLineArgs *args, const QCString &
name_required = false;
}
else {//open, design, text...
- QString defaultType;
+ TQString defaultType;
if (action_name=="execute")
defaultType = "macro";
else
@@ -231,7 +231,7 @@ bool KexiStartupHandler::getAutoopenObjects(KCmdLineArgs *args, const QCString &
if (stripQuotes(item, obj_name)) {
type_name = defaultType;
}
- else if ((idx = item.find(':'))!=-1) {
+ else if ((idx = item.tqfind(':'))!=-1) {
//option with type name specified:
type_name = item.left(idx).lower();
obj_name = item.mid(idx+1);
@@ -274,7 +274,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
KexiDB::ConnectionData cdata;
- const QString connectionShortcutFileName( args->getOption("connection") );
+ const TQString connectionShortcutFileName( args->getOption("connection") );
if (!connectionShortcutFileName.isEmpty()) {
KexiDBConnShortcutFile connectionShortcut( connectionShortcutFileName );
if (!connectionShortcut.loadConnectionData(cdata)) {
@@ -283,7 +283,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
KMessageBox::sorry( 0, "<qt>"
+i18n("Could not read connection information from connection shortcut "
"file <nobr>\"%1\"</nobr>.<br><br>Check whether the file has valid contents.")
- .arg(QDir::convertSeparators(connectionShortcut.fileName())));
+ .tqarg(TQDir::convertSeparators(connectionShortcut.fileName())));
return false;
}
}
@@ -291,11 +291,11 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
if (!args->getOption("dbdriver").isEmpty())
cdata.driverName = args->getOption("dbdriver");
- QString fileType( args->getOption("type").lower() );
+ TQString fileType( args->getOption("type").lower() );
if (args->count()>0 && (!fileType.isEmpty() && fileType!="project" && fileType!="shortcut" && fileType!="connection")) {
KMessageBox::sorry( 0,
i18n("You have specified invalid argument (\"%1\") for \"type\" command-line option.")
- .arg(fileType));
+ .tqarg(fileType));
return false;
}
@@ -330,7 +330,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
if (qstrcmp("--password",argv[i])==0
|| qstrcmp("-password",argv[i])==0)
{
- QCString pwd(argv[i+1]);
+ TQCString pwd(argv[i+1]);
if (!pwd.isEmpty()) {
pwd.fill(' ');
pwd[0]='x';
@@ -341,7 +341,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
}
*/
- const QString portStr = args->getOption("port");
+ const TQString portStr = args->getOption("port");
if (!portStr.isEmpty()) {
bool ok;
const int p = portStr.toInt(&ok);
@@ -364,7 +364,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
const bool dropDB = args->isSet("dropdb");
const bool openExisting = !createDB && !dropDB;
const bool readOnly = args->isSet("readonly");
- const QString couldnotMsg = QString::fromLatin1("\n")
+ const TQString couldnotMsg = TQString::tqfromLatin1("\n")
+i18n("Could not start Kexi application this way.");
if (createDB && dropDB) {
@@ -388,13 +388,13 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
if (cdata.password.isEmpty()) {
delete d->passwordDialog;
d->passwordDialog = new KexiDBPasswordDialog(0, cdata, true);
-// connect( d->passwordDialog, SIGNAL(user1Clicked()),
-// this, SLOT(slotShowConnectionDetails()) );
+// connect( d->passwordDialog, TQT_SIGNAL(user1Clicked()),
+// this, TQT_SLOT(slotShowConnectionDetails()) );
const int ret = d->passwordDialog->exec();
- if (d->passwordDialog->showConnectionDetailsRequested() || ret == QDialog::Accepted) {
-// if ( ret == QDialog::Accepted ) {
- // if (QDialog::Accepted == KPasswordDialog::getPassword(pwd, msg)) {
-//moved cdata.password = QString(pwd);
+ if (d->passwordDialog->showConnectionDetailsRequested() || ret == TQDialog::Accepted) {
+// if ( ret == TQDialog::Accepted ) {
+ // if (TQDialog::Accepted == KPasswordDialog::getPassword(pwd, msg)) {
+//moved cdata.password = TQString(pwd);
// }
} else {
m_action = Exit;
@@ -416,17 +416,17 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
//database filenames, shortcut filenames or db names on a server
if (args->count()>=1) {
- QString prjName;
- QString fileName;
+ TQString prjName;
+ TQString fileName;
if (fileDriverSelected) {
- fileName = QFile::decodeName(args->arg(0));
+ fileName = TQFile::decodeName(args->arg(0));
}
else {
- prjName = QString::fromLocal8Bit(args->arg(0));
+ prjName = TQString::fromLocal8Bit(args->arg(0));
}
if (fileDriverSelected) {
- QFileInfo finfo(fileName);
+ TQFileInfo finfo(fileName);
prjName = finfo.fileName(); //filename only, to avoid messy names like when Kexi is started with "../../db" arg
cdata.setFileName( finfo.absFilePath() );
projectFileExists = finfo.exists();
@@ -434,7 +434,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
if (dropDB && !projectFileExists) {
KMessageBox::sorry(0,
i18n("Could not remove project.\nThe file \"%1\" does not exist.")
- .arg(QDir::convertSeparators(cdata.dbFileName())));
+ .tqarg(TQDir::convertSeparators(cdata.dbFileName())));
return 0;
}
}
@@ -457,7 +457,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
if (dropDB)
detectOptions |= DontConvert;
- QString detectedDriverName;
+ TQString detectedDriverName;
const tristate res = detectActionForFile( m_importActionData, detectedDriverName,
cdata.driverName, cdata.fileName(), 0, detectOptions );
if (true != res)
@@ -476,7 +476,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
m_projectData = new KexiProjectData();
if (!d->shortcutFile->loadProjectData(*m_projectData, &d->shortcutFileGroupKey)) {
KMessageBox::sorry(0, i18n("Could not open shortcut file\n\"%1\".")
- .arg(QDir::convertSeparators(cdata.fileName())));
+ .tqarg(TQDir::convertSeparators(cdata.fileName())));
delete m_projectData;
m_projectData = 0;
delete d->shortcutFile;
@@ -485,10 +485,10 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
}
d->connDialog = new KexiDBConnectionDialog(
*m_projectData, d->shortcutFile->fileName());
- connect(d->connDialog, SIGNAL(saveChanges()),
- this, SLOT(slotSaveShortcutFileChanges()));
+ connect(d->connDialog, TQT_SIGNAL(saveChanges()),
+ this, TQT_SLOT(slotSaveShortcutFileChanges()));
int res = d->connDialog->exec();
- if (res == QDialog::Accepted) {
+ if (res == TQDialog::Accepted) {
//get (possibly changed) prj data
*m_projectData = d->connDialog->currentProjectData();
}
@@ -498,7 +498,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
delete d->shortcutFile;
d->shortcutFile = 0;
- if (res == QDialog::Rejected) {
+ if (res == TQDialog::Rejected) {
delete m_projectData;
m_projectData = 0;
return cancelled;
@@ -509,7 +509,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
d->connShortcutFile = new KexiDBConnShortcutFile(cdata.fileName());
if (!d->connShortcutFile->loadConnectionData(cdata, &d->shortcutFileGroupKey)) {
KMessageBox::sorry(0, i18n("Could not open connection data file\n\"%1\".")
- .arg(QDir::convertSeparators(cdata.fileName())));
+ .tqarg(TQDir::convertSeparators(cdata.fileName())));
delete d->connShortcutFile;
d->connShortcutFile = 0;
return false;
@@ -522,11 +522,11 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
if (!d->connDialog) {
d->connDialog = new KexiDBConnectionDialog(
cdata, d->connShortcutFile->fileName());
- connect(d->connDialog, SIGNAL(saveChanges()),
- this, SLOT(slotSaveShortcutFileChanges()));
+ connect(d->connDialog, TQT_SIGNAL(saveChanges()),
+ this, TQT_SLOT(slotSaveShortcutFileChanges()));
}
const int res = d->connDialog->exec();
- if (res == QDialog::Accepted) {
+ if (res == TQDialog::Accepted) {
//get (possibly changed) prj data
cdata = *d->connDialog->currentProjectData().constConnectionData();
}
@@ -565,11 +565,11 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
//let's show connection details, user asked for that in the "password dialog"
if (d->passwordDialog && d->passwordDialog->showConnectionDetailsRequested()) {
d->connDialog = new KexiDBConnectionDialog(*m_projectData);
-// connect(d->connDialog->tabWidget->mainWidget, SIGNAL(saveChanges()),
-// this, SLOT(slotSaveShortcutFileChanges()));
+// connect(d->connDialog->tabWidget->mainWidget, TQT_SIGNAL(saveChanges()),
+// this, TQT_SLOT(slotSaveShortcutFileChanges()));
int res = d->connDialog->exec();
- if (res == QDialog::Accepted) {
+ if (res == TQDialog::Accepted) {
//get (possibly changed) prj data
*m_projectData = d->connDialog->currentProjectData();
}
@@ -577,7 +577,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
delete d->connDialog;
d->connDialog = 0;
- if (res == QDialog::Rejected) {
+ if (res == TQDialog::Rejected) {
delete m_projectData;
m_projectData = 0;
return cancelled;
@@ -612,7 +612,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
if (!alsoOpenDB) {
if (ok) {
KMessageBox::information( 0, i18n("Project \"%1\" created successfully.")
- .arg( QDir::convertSeparators(projectData()->databaseName()) ));
+ .tqarg( TQDir::convertSeparators(projectData()->databaseName()) ));
}
return ok;
}
@@ -622,7 +622,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
tristate res = KexiProject::dropProject(projectData(), &gui, false/*ask*/);
if (res==true)
KMessageBox::information( 0, i18n("Project \"%1\" dropped successfully.")
- .arg( QDir::convertSeparators(projectData()->databaseName()) ));
+ .tqarg( TQDir::convertSeparators(projectData()->databaseName()) ));
return res!=false;
}
@@ -646,7 +646,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
KexiStartupDialog::Everything, KexiStartupDialog::CheckBoxDoNotShowAgain,
Kexi::connset(), Kexi::recentProjects(), 0, "KexiStartupDialog");
}
- if (d->startupDialog->exec()!=QDialog::Accepted)
+ if (d->startupDialog->exec()!=TQDialog::Accepted)
return true;
const int r = d->startupDialog->result();
@@ -659,9 +659,9 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
return true;
}
else if (r == KexiStartupDialog::CreateFromTemplateResult) {
- const QString selFile( d->startupDialog->selectedFileName() );
+ const TQString selFile( d->startupDialog->selectedFileName() );
cdata.setFileName( selFile );
- QString detectedDriverName;
+ TQString detectedDriverName;
const tristate res = detectActionForFile( m_importActionData, detectedDriverName,
cdata.driverName, selFile );
if (true != res)
@@ -676,12 +676,12 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
}
else if (r == KexiStartupDialog::OpenExistingResult) {
// kdDebug() << "Existing project --------" << endl;
- const QString selFile( d->startupDialog->selectedFileName() );
+ const TQString selFile( d->startupDialog->selectedFileName() );
if (!selFile.isEmpty()) {
//file-based project
// kdDebug() << "Project File: " << selFile << endl;
cdata.setFileName( selFile );
- QString detectedDriverName;
+ TQString detectedDriverName;
const tristate res = detectActionForFile( m_importActionData, detectedDriverName,
cdata.driverName, selFile );
if (true != res)
@@ -738,25 +738,25 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
}
tristate KexiStartupHandler::detectActionForFile(
- KexiStartupData::Import& detectedImportAction, QString& detectedDriverName,
- const QString& _suggestedDriverName, const QString &dbFileName, QWidget *parent, int options )
+ KexiStartupData::Import& detectedImportAction, TQString& detectedDriverName,
+ const TQString& _suggestedDriverName, const TQString &dbFileName, TQWidget *tqparent, int options )
{
detectedImportAction = KexiStartupData::Import(); //clear
- QString suggestedDriverName(_suggestedDriverName); //safe
- detectedDriverName = QString::null;
- QFileInfo finfo(dbFileName);
+ TQString suggestedDriverName(_suggestedDriverName); //safe
+ detectedDriverName = TQString();
+ TQFileInfo finfo(dbFileName);
if (dbFileName.isEmpty() || !finfo.isReadable()) {
if (!(options & SkipMessages))
- KMessageBox::sorry(parent, i18n("<p>Could not open project.</p>")
+ KMessageBox::sorry(tqparent, i18n("<p>Could not open project.</p>")
+i18n("<p>The file <nobr>\"%1\"</nobr> does not exist or is not readable.</p>")
- .arg(QDir::convertSeparators(dbFileName))
+ .tqarg(TQDir::convertSeparators(dbFileName))
+i18n("Check the file's permissions and whether it is already opened "
"and locked by another application."));
return false;
}
KMimeType::Ptr ptr;
- QString mimename;
+ TQString mimename;
const bool thisIsShortcut = (options & ThisIsAShortcutToAProjectFile)
|| (options & ThisIsAShortcutToAConnectionData);
@@ -775,13 +775,13 @@ tristate KexiStartupHandler::detectActionForFile(
}
if (mimename.isEmpty() || mimename=="application/octet-stream") {
// perhaps the file is locked
- QFile f(dbFileName);
+ TQFile f(dbFileName);
if (!f.open(IO_ReadOnly)) {
// BTW: similar error msg is provided in SQLiteConnection::drv_useDatabase()
if (!(options & SkipMessages))
- KMessageBox::sorry(parent, i18n("<p>Could not open project.</p>")
+ KMessageBox::sorry(tqparent, i18n("<p>Could not open project.</p>")
+i18n("<p>The file <nobr>\"%1\"</nobr> is not readable.</p>")
- .arg(QDir::convertSeparators(dbFileName))
+ .tqarg(TQDir::convertSeparators(dbFileName))
+i18n("Check the file's permissions and whether it is already opened "
"and locked by another application."));
return false;
@@ -802,9 +802,9 @@ tristate KexiStartupHandler::detectActionForFile(
if (ptr.data()) {
if (mimename=="application/x-msaccess") {
if ((options & SkipMessages) || KMessageBox::Yes != KMessageBox::questionYesNo(
- parent, i18n("\"%1\" is an external file of type:\n\"%2\".\n"
+ tqparent, i18n("\"%1\" is an external file of type:\n\"%2\".\n"
"Do you want to import the file as a Kexi project?")
- .arg(QDir::convertSeparators(dbFileName)).arg(ptr.data()->comment()),
+ .tqarg(TQDir::convertSeparators(dbFileName)).tqarg(ptr.data()->comment()),
i18n("Open External File"), KGuiItem(i18n("Import...")), KStdGuiItem::cancel() ) )
{
return cancelled;
@@ -820,18 +820,18 @@ tristate KexiStartupHandler::detectActionForFile(
}
// "application/x-kexiproject-sqlite", etc.:
- QString tmpDriverName = Kexi::driverManager().lookupByMime(mimename).latin1();
+ TQString tmpDriverName = Kexi::driverManager().lookupByMime(mimename).latin1();
//@todo What about trying to reuse KOFFICE FILTER CHAINS here?
bool useDetectedDriver = suggestedDriverName.isEmpty() || suggestedDriverName.lower()==detectedDriverName.lower();
if (!useDetectedDriver) {
int res = KMessageBox::Yes;
if (!(options & SkipMessages))
- res = KMessageBox::warningYesNoCancel(parent, i18n(
+ res = KMessageBox::warningYesNoCancel(tqparent, i18n(
"The project file \"%1\" is recognized as compatible with \"%2\" database driver, "
"while you have asked for \"%3\" database driver to be used.\n"
"Do you want to use \"%4\" database driver?")
- .arg(QDir::convertSeparators(dbFileName))
- .arg(tmpDriverName).arg(suggestedDriverName).arg(tmpDriverName));
+ .tqarg(TQDir::convertSeparators(dbFileName))
+ .tqarg(tmpDriverName).tqarg(suggestedDriverName).tqarg(tmpDriverName));
if (KMessageBox::Yes == res)
useDetectedDriver = true;
else if (KMessageBox::Cancel == res)
@@ -845,13 +845,13 @@ tristate KexiStartupHandler::detectActionForFile(
}
// kdDebug() << "KexiStartupHandler::detectActionForFile(): driver name: " << detectedDriverName << endl;
//hardcoded for convenience:
- const QString newFileFormat = "SQLite3";
+ const TQString newFileFormat = "SQLite3";
if (!(options & DontConvert || options & SkipMessages)
&& detectedDriverName.lower()=="sqlite2" && detectedDriverName.lower()!=suggestedDriverName.lower()
- && KMessageBox::Yes == KMessageBox::questionYesNo(parent, i18n(
+ && KMessageBox::Yes == KMessageBox::questionYesNo(tqparent, i18n(
"Previous version of database file format (\"%1\") is detected in the \"%2\" "
"project file.\nDo you want to convert the project to a new \"%3\" format (recommended)?")
- .arg(detectedDriverName).arg(QDir::convertSeparators(dbFileName)).arg(newFileFormat)) )
+ .tqarg(detectedDriverName).tqarg(TQDir::convertSeparators(dbFileName)).tqarg(newFileFormat)) )
{
// SQLite2ToSQLite3Migration *migr = new
SQLite2ToSQLite3Migration migr( finfo.absFilePath() );
@@ -859,10 +859,10 @@ tristate KexiStartupHandler::detectActionForFile(
// kdDebug() << "--- migr.run() END ---" <<endl;
if (!res) {
//TODO msg
- KMessageBox::sorry(parent, i18n(
+ KMessageBox::sorry(tqparent, i18n(
"Failed to convert project file \"%1\" to a new \"%2\" format.\n"
"The file format remains unchanged.")
- .arg(QDir::convertSeparators(dbFileName)).arg(newFileFormat) );
+ .tqarg(TQDir::convertSeparators(dbFileName)).tqarg(newFileFormat) );
//continue...
}
if (res==true)
@@ -870,21 +870,21 @@ tristate KexiStartupHandler::detectActionForFile(
}
// action.driverName = detectedDriverName;
if (detectedDriverName.isEmpty()) {
- QString possibleProblemsInfoMsg( Kexi::driverManager().possibleProblemsInfoMsg() );
+ TQString possibleProblemsInfoMsg( Kexi::driverManager().possibleProblemsInfoMsg() );
if (!possibleProblemsInfoMsg.isEmpty()) {
- possibleProblemsInfoMsg.prepend(QString::fromLatin1("<p>")+i18n("Possible problems:"));
- possibleProblemsInfoMsg += QString::fromLatin1("</p>");
+ possibleProblemsInfoMsg.prepend(TQString::tqfromLatin1("<p>")+i18n("Possible problems:"));
+ possibleProblemsInfoMsg += TQString::tqfromLatin1("</p>");
}
if (!(options & SkipMessages))
- KMessageBox::detailedSorry(parent,
+ KMessageBox::detailedSorry(tqparent,
i18n( "The file \"%1\" is not recognized as being supported by Kexi.")
- .arg(QDir::convertSeparators(dbFileName)),
- QString::fromLatin1("<p>")
+ .tqarg(TQDir::convertSeparators(dbFileName)),
+ TQString::tqfromLatin1("<p>")
+i18n("Database driver for this file type not found.\nDetected MIME type: %1")
- .arg(mimename)
+ .tqarg(mimename)
+(ptr.data()->comment().isEmpty()
- ? QString::fromLatin1(".") : QString::fromLatin1(" (%1).").arg(ptr.data()->comment()))
- +QString::fromLatin1("</p>")
+ ? TQString::tqfromLatin1(".") : TQString::tqfromLatin1(" (%1).").tqarg(ptr.data()->comment()))
+ +TQString::tqfromLatin1("</p>")
+possibleProblemsInfoMsg);
return false;
}
@@ -892,9 +892,9 @@ tristate KexiStartupHandler::detectActionForFile(
}
KexiProjectData*
-KexiStartupHandler::selectProject(KexiDB::ConnectionData *cdata, bool& cancelled, QWidget *parent)
+KexiStartupHandler::selectProject(KexiDB::ConnectionData *cdata, bool& cancelled, TQWidget *tqparent)
{
- clearStatus();
+ cleartqStatus();
cancelled = false;
if (!cdata)
return 0;
@@ -902,7 +902,7 @@ KexiStartupHandler::selectProject(KexiDB::ConnectionData *cdata, bool& cancelled
if (!d->passwordDialog)
d->passwordDialog = new KexiDBPasswordDialog(0, *cdata, false);
const int ret = d->passwordDialog->exec();
- if (d->passwordDialog->showConnectionDetailsRequested() || ret == QDialog::Accepted) {
+ if (d->passwordDialog->showConnectionDetailsRequested() || ret == TQDialog::Accepted) {
} else {
cancelled = true;
@@ -911,22 +911,22 @@ KexiStartupHandler::selectProject(KexiDB::ConnectionData *cdata, bool& cancelled
}
KexiProjectData* projectData = 0;
//dialog for selecting a project
- KexiProjectSelectorDialog prjdlg( parent, "prjdlg", cdata, true, false );
+ KexiProjectSelectorDialog prjdlg( tqparent, "prjdlg", cdata, true, false );
if (!prjdlg.projectSet() || prjdlg.projectSet()->error()) {
KexiGUIMessageHandler msgh;
if (prjdlg.projectSet())
msgh.showErrorMessage(prjdlg.projectSet(),
i18n("Could not load list of available projects for <b>%1</b> database server.")
- .arg(cdata->serverInfoString(true)));
+ .tqarg(cdata->serverInfoString(true)));
else
msgh.showErrorMessage(
i18n("Could not load list of available projects for <b>%1</b> database server.")
- .arg(cdata->serverInfoString(true)));
-// setStatus(i18n("Could not load list of available projects for database server \"%1\"")
-// .arg(cdata->serverInfoString(true)), prjdlg.projectSet()->errorMsg());
+ .tqarg(cdata->serverInfoString(true)));
+// settqStatus(i18n("Could not load list of available projects for database server \"%1\"")
+// .tqarg(cdata->serverInfoString(true)), prjdlg.projectSet()->errorMsg());
return 0;
}
- if (prjdlg.exec()!=QDialog::Accepted) {
+ if (prjdlg.exec()!=TQDialog::Accepted) {
cancelled = true;
return 0;
}
@@ -952,7 +952,7 @@ void KexiStartupHandler::slotSaveShortcutFileChanges()
if (!ok) {
KMessageBox::sorry(0, i18n("Failed saving connection data to\n\"%1\" file.")
- .arg(QDir::convertSeparators(d->shortcutFile->fileName())));
+ .tqarg(TQDir::convertSeparators(d->shortcutFile->fileName())));
}
}