|
|
|
@ -736,7 +736,7 @@ KioskRun::setupRuntimeEnv()
|
|
|
|
|
{
|
|
|
|
|
if (m_dcopClient) return true;
|
|
|
|
|
|
|
|
|
|
KioskRunProgressDialog dlg(kapp->mainWidget(), "kioskrun_progress",
|
|
|
|
|
KioskRunProgressDialog dlg(tdeApp->mainWidget(), "kioskrun_progress",
|
|
|
|
|
i18n("Setting Up Configuration Environment"),
|
|
|
|
|
i18n("Setting up configuration environment."));
|
|
|
|
|
|
|
|
|
@ -903,10 +903,10 @@ KioskRun::createDir(const TQString &dir)
|
|
|
|
|
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
if (NETACCESS::exists(dest, false, kapp->mainWidget()))
|
|
|
|
|
if (NETACCESS::exists(dest, false, tdeApp->mainWidget()))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
bool result = NETACCESS::mkdir(dest, kapp->mainWidget(), 0755);
|
|
|
|
|
bool result = NETACCESS::mkdir(dest, tdeApp->mainWidget(), 0755);
|
|
|
|
|
if (result == true)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
@ -924,7 +924,7 @@ KioskRun::createDir(const TQString &dir)
|
|
|
|
|
msg += i18n("Without this directory your changes can not be saved.<p>"
|
|
|
|
|
"Do you want to retry creating the directory or abort the saving of changes?</qt>");
|
|
|
|
|
|
|
|
|
|
int msgResult = KMessageBox::warningYesNo(kapp->mainWidget(), msg, TQString(),
|
|
|
|
|
int msgResult = KMessageBox::warningYesNo(tdeApp->mainWidget(), msg, TQString(),
|
|
|
|
|
i18n("&Retry"), i18n("&Abort"));
|
|
|
|
|
|
|
|
|
|
if (msgResult == KMessageBox::No)
|
|
|
|
@ -942,12 +942,12 @@ KioskRun::createDir(const TQString &dir)
|
|
|
|
|
bool
|
|
|
|
|
KioskRun::createRemoteDirRecursive(const KURL &dest, bool ask)
|
|
|
|
|
{
|
|
|
|
|
if (NETACCESS::exists(dest, false, kapp->mainWidget()))
|
|
|
|
|
if (NETACCESS::exists(dest, false, tdeApp->mainWidget()))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
KURL parent = dest.upURL();
|
|
|
|
|
|
|
|
|
|
if (NETACCESS::exists(dest, false, kapp->mainWidget()))
|
|
|
|
|
if (NETACCESS::exists(dest, false, tdeApp->mainWidget()))
|
|
|
|
|
{
|
|
|
|
|
return createRemoteDir(dest);
|
|
|
|
|
}
|
|
|
|
@ -955,7 +955,7 @@ KioskRun::createRemoteDirRecursive(const KURL &dest, bool ask)
|
|
|
|
|
if (ask)
|
|
|
|
|
{
|
|
|
|
|
// Parent doesn't exist,
|
|
|
|
|
int result = KMessageBox::warningContinueCancel(kapp->mainWidget(),
|
|
|
|
|
int result = KMessageBox::warningContinueCancel(tdeApp->mainWidget(),
|
|
|
|
|
i18n("<qt>The directory <b>%1</b> does not yet exist. "
|
|
|
|
|
"Do you want to create it?").arg(parent.prettyURL()), TQString(),
|
|
|
|
|
i18n("Create &Dir"));
|
|
|
|
@ -980,10 +980,10 @@ KioskRun::createRemoteDir(const KURL &dest)
|
|
|
|
|
{
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
if (NETACCESS::exists(dest, false, kapp->mainWidget()))
|
|
|
|
|
if (NETACCESS::exists(dest, false, tdeApp->mainWidget()))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
if (NETACCESS::mkdir(dest, kapp->mainWidget(), 0755))
|
|
|
|
|
if (NETACCESS::mkdir(dest, tdeApp->mainWidget(), 0755))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
#if KDE_IS_VERSION(3,2,91)
|
|
|
|
@ -1006,7 +1006,7 @@ KioskRun::createRemoteDir(const KURL &dest)
|
|
|
|
|
msg += i18n("Without this directory your files can not be uploaded.<p>"
|
|
|
|
|
"Do you want to retry creating the directory or abort uploading?</qt>");
|
|
|
|
|
|
|
|
|
|
int msgResult = KMessageBox::warningYesNo(kapp->mainWidget(), msg, TQString(),
|
|
|
|
|
int msgResult = KMessageBox::warningYesNo(tdeApp->mainWidget(), msg, TQString(),
|
|
|
|
|
i18n("&Retry"), i18n("&Abort"));
|
|
|
|
|
|
|
|
|
|
if (msgResult == KMessageBox::No)
|
|
|
|
@ -1036,7 +1036,7 @@ KioskRun::install(const TQString &file, const TQString &destination)
|
|
|
|
|
{
|
|
|
|
|
KURL src;
|
|
|
|
|
src.setPath(file);
|
|
|
|
|
bool result = NETACCESS::file_copy(src, dest, 0644, true, false, kapp->mainWidget());
|
|
|
|
|
bool result = NETACCESS::file_copy(src, dest, 0644, true, false, tdeApp->mainWidget());
|
|
|
|
|
if (result == true)
|
|
|
|
|
{
|
|
|
|
|
::unlink(TQFile::encodeName(file));
|
|
|
|
@ -1055,7 +1055,7 @@ KioskRun::install(const TQString &file, const TQString &destination)
|
|
|
|
|
|
|
|
|
|
msg += i18n("Do you want to retry the installation or abort the saving of changes?</qt>");
|
|
|
|
|
|
|
|
|
|
int msgResult = KMessageBox::warningYesNo(kapp->mainWidget(), msg, TQString(),
|
|
|
|
|
int msgResult = KMessageBox::warningYesNo(tdeApp->mainWidget(), msg, TQString(),
|
|
|
|
|
i18n("&Retry"), i18n("&Abort"));
|
|
|
|
|
|
|
|
|
|
if (msgResult == KMessageBox::No)
|
|
|
|
@ -1073,7 +1073,7 @@ KioskRun::uploadRemote(const TQString &file, const KURL &dest)
|
|
|
|
|
{
|
|
|
|
|
KURL src;
|
|
|
|
|
src.setPath(file);
|
|
|
|
|
bool result = NETACCESS::file_copy(src, dest, 0644, true, false, kapp->mainWidget());
|
|
|
|
|
bool result = NETACCESS::file_copy(src, dest, 0644, true, false, tdeApp->mainWidget());
|
|
|
|
|
if (result == true)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
@ -1089,7 +1089,7 @@ KioskRun::uploadRemote(const TQString &file, const KURL &dest)
|
|
|
|
|
|
|
|
|
|
msg += i18n("Do you want to retry or abort the uploading?</qt>");
|
|
|
|
|
|
|
|
|
|
int msgResult = KMessageBox::warningYesNo(kapp->mainWidget(), msg, TQString(),
|
|
|
|
|
int msgResult = KMessageBox::warningYesNo(tdeApp->mainWidget(), msg, TQString(),
|
|
|
|
|
i18n("&Retry"), i18n("&Abort"));
|
|
|
|
|
|
|
|
|
|
if (msgResult == KMessageBox::No)
|
|
|
|
@ -1112,7 +1112,7 @@ KioskRun::remove(const TQString &destination)
|
|
|
|
|
}
|
|
|
|
|
dest.setPath(destination);
|
|
|
|
|
|
|
|
|
|
return NETACCESS::del(dest, kapp->mainWidget());
|
|
|
|
|
return NETACCESS::del(dest, tdeApp->mainWidget());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Move file or directory
|
|
|
|
@ -1141,7 +1141,7 @@ kdDebug() << "Moving " << src << " --> " << dest << endl;
|
|
|
|
|
if (!createRemoteDirRecursive(dest.upURL(), false))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (!NETACCESS::file_move(src, dest, -1, true, false, kapp->mainWidget()))
|
|
|
|
|
if (!NETACCESS::file_move(src, dest, -1, true, false, tdeApp->mainWidget()))
|
|
|
|
|
{
|
|
|
|
|
// TODO add error message + retry
|
|
|
|
|
return false;
|
|
|
|
@ -1154,7 +1154,7 @@ kdDebug() << "Moving " << src << " --> " << dest << endl;
|
|
|
|
|
void
|
|
|
|
|
KioskRun::getProfileInfo(const TQString &profile, TQString &description, TQString &installDir, TQString &installUser)
|
|
|
|
|
{
|
|
|
|
|
TDEConfig *config = kapp->config();
|
|
|
|
|
TDEConfig *config = tdeApp->config();
|
|
|
|
|
|
|
|
|
|
TQString defaultInstallDir = getProfilePrefix();
|
|
|
|
|
if (defaultInstallDir.isEmpty())
|
|
|
|
@ -1202,7 +1202,7 @@ KioskRun::openKderc()
|
|
|
|
|
KURL settingsUrl;
|
|
|
|
|
settingsUrl.setPath(m_tderc);
|
|
|
|
|
|
|
|
|
|
m_localKderc = ::locateLocal("tmp", "tderc_"+kapp->randomString(5));
|
|
|
|
|
m_localKderc = ::locateLocal("tmp", "tderc_"+tdeApp->randomString(5));
|
|
|
|
|
::unlink(TQFile::encodeName(m_localKderc));
|
|
|
|
|
|
|
|
|
|
KURL localCopyUrl;
|
|
|
|
@ -1211,7 +1211,7 @@ KioskRun::openKderc()
|
|
|
|
|
if (TQFile::exists(settingsUrl.path()))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
while (!NETACCESS::copy(settingsUrl, localCopyUrl, kapp->mainWidget()))
|
|
|
|
|
while (!NETACCESS::copy(settingsUrl, localCopyUrl, tdeApp->mainWidget()))
|
|
|
|
|
{
|
|
|
|
|
TQString error = NETACCESS::lastErrorString();
|
|
|
|
|
TQString msg;
|
|
|
|
@ -1225,7 +1225,7 @@ KioskRun::openKderc()
|
|
|
|
|
|
|
|
|
|
msg += i18n("Do you want to retry the operation or abort the saving of changes?</qt>");
|
|
|
|
|
|
|
|
|
|
int msgResult = KMessageBox::warningYesNo(kapp->mainWidget(), msg, TQString(),
|
|
|
|
|
int msgResult = KMessageBox::warningYesNo(tdeApp->mainWidget(), msg, TQString(),
|
|
|
|
|
i18n("&Retry"), i18n("&Abort"));
|
|
|
|
|
|
|
|
|
|
if (msgResult == KMessageBox::No)
|
|
|
|
@ -1251,7 +1251,7 @@ KioskRun::closeKderc()
|
|
|
|
|
bool result = install(m_localKderc, m_tderc);
|
|
|
|
|
m_localKderc = TQString();
|
|
|
|
|
m_user = saveUser;
|
|
|
|
|
kapp->config()->reparseConfiguration();
|
|
|
|
|
tdeApp->config()->reparseConfiguration();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1270,7 +1270,7 @@ KioskRun::setProfileInfo(const TQString &profile, const TQString &description, c
|
|
|
|
|
if (deleteProfile && !installDir.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
bool result = true;
|
|
|
|
|
KioskSync profileDir(kapp->mainWidget());
|
|
|
|
|
KioskSync profileDir(tdeApp->mainWidget());
|
|
|
|
|
profileDir.addDir(installDir, KURL());
|
|
|
|
|
TQStringList allFiles = profileDir.listFiles();
|
|
|
|
|
allFiles.remove(".kdeprofile");
|
|
|
|
@ -1285,7 +1285,7 @@ KioskRun::setProfileInfo(const TQString &profile, const TQString &description, c
|
|
|
|
|
}
|
|
|
|
|
else if (deleteFiles)
|
|
|
|
|
{
|
|
|
|
|
int msgResult = KMessageBox::warningYesNoCancelList(kapp->mainWidget(),
|
|
|
|
|
int msgResult = KMessageBox::warningYesNoCancelList(tdeApp->mainWidget(),
|
|
|
|
|
i18n("<qt>The profile directory <b>%1</b> contains the following files, "
|
|
|
|
|
"do you wish to delete these files?").arg(installDir),
|
|
|
|
|
allFiles,
|
|
|
|
@ -1328,7 +1328,7 @@ KioskRun::setProfileInfo(const TQString &profile, const TQString &description, c
|
|
|
|
|
else if ((description != oldDescription) ||
|
|
|
|
|
(installUser != oldInstallUser))
|
|
|
|
|
{
|
|
|
|
|
TQString localProfileInfo = ::locateLocal("tmp", "kdeprofile_"+kapp->randomString(5));
|
|
|
|
|
TQString localProfileInfo = ::locateLocal("tmp", "kdeprofile_"+tdeApp->randomString(5));
|
|
|
|
|
::unlink(TQFile::encodeName(localProfileInfo));
|
|
|
|
|
KSimpleConfig newProfileInfo(localProfileInfo);
|
|
|
|
|
newProfileInfo.writeEntry("Description", description);
|
|
|
|
@ -1342,7 +1342,7 @@ KioskRun::setProfileInfo(const TQString &profile, const TQString &description, c
|
|
|
|
|
KUser thisUser;
|
|
|
|
|
TQString newAdmin = thisUser.loginName()+":"; // This user, all hosts
|
|
|
|
|
|
|
|
|
|
TDEConfig *config = kapp->config();
|
|
|
|
|
TDEConfig *config = tdeApp->config();
|
|
|
|
|
|
|
|
|
|
config->setGroup("Directories");
|
|
|
|
|
TQString oldAdmin = config->readEntry("kioskAdmin");
|
|
|
|
@ -1391,7 +1391,7 @@ KioskRun::deleteProfile(const TQString &profile, bool deleteFiles)
|
|
|
|
|
TQString
|
|
|
|
|
KioskRun::getProfilePrefix()
|
|
|
|
|
{
|
|
|
|
|
TDEConfig *config = kapp->config();
|
|
|
|
|
TDEConfig *config = tdeApp->config();
|
|
|
|
|
|
|
|
|
|
config->setGroup("Directories");
|
|
|
|
|
|
|
|
|
@ -1430,7 +1430,7 @@ KioskRun::newProfile()
|
|
|
|
|
{
|
|
|
|
|
TQString profilePrefix = getProfilePrefix();
|
|
|
|
|
|
|
|
|
|
TDEConfig *config = kapp->config();
|
|
|
|
|
TDEConfig *config = tdeApp->config();
|
|
|
|
|
for(int p = 1; p; p++)
|
|
|
|
|
{
|
|
|
|
|
TQString profile = TQString("profile%1").arg(p);
|
|
|
|
@ -1453,7 +1453,7 @@ KioskRun::newProfile()
|
|
|
|
|
TQStringList
|
|
|
|
|
KioskRun::allProfiles()
|
|
|
|
|
{
|
|
|
|
|
TDEConfig *config = kapp->config();
|
|
|
|
|
TDEConfig *config = tdeApp->config();
|
|
|
|
|
TQStringList groups = config->groupList();
|
|
|
|
|
TQStringList profiles;
|
|
|
|
|
TQStringList directories;
|
|
|
|
@ -1514,7 +1514,7 @@ KioskRun::getUserProfileMappings( ProfileMapping &groups, ProfileMapping &users,
|
|
|
|
|
groups.clear();
|
|
|
|
|
users.clear();
|
|
|
|
|
|
|
|
|
|
TDEConfig *config = kapp->config();
|
|
|
|
|
TDEConfig *config = tdeApp->config();
|
|
|
|
|
config->setGroup("Directories");
|
|
|
|
|
TQString mapFile = config->readEntry("userProfileMapFile");
|
|
|
|
|
|
|
|
|
@ -1550,7 +1550,7 @@ KioskRun::getUserProfileMappings( ProfileMapping &groups, ProfileMapping &users,
|
|
|
|
|
bool
|
|
|
|
|
KioskRun::setUserProfileMappings( const ProfileMapping &groups, const ProfileMapping &users, const TQStringList &groupOrder)
|
|
|
|
|
{
|
|
|
|
|
TDEConfig *config = kapp->config();
|
|
|
|
|
TDEConfig *config = tdeApp->config();
|
|
|
|
|
config->setGroup("Directories");
|
|
|
|
|
TQString mapFile = config->readEntry("userProfileMapFile");
|
|
|
|
|
if (mapFile.isEmpty())
|
|
|
|
@ -1567,7 +1567,7 @@ KioskRun::setUserProfileMappings( const ProfileMapping &groups, const ProfileMap
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQString localMapFile = ::locateLocal("tmp", "kde-user-profile_"+kapp->randomString(5));
|
|
|
|
|
TQString localMapFile = ::locateLocal("tmp", "kde-user-profile_"+tdeApp->randomString(5));
|
|
|
|
|
::unlink(TQFile::encodeName(localMapFile));
|
|
|
|
|
|
|
|
|
|
KSimpleConfig mapConfig(localMapFile);
|
|
|
|
|