diff --git a/code/nel/src/gui/ctrl_text_button.cpp b/code/nel/src/gui/ctrl_text_button.cpp
index 2fb19a9fc..c292d5473 100644
--- a/code/nel/src/gui/ctrl_text_button.cpp
+++ b/code/nel/src/gui/ctrl_text_button.cpp
@@ -43,8 +43,8 @@ namespace NLGUI
_BmpLeftW= _BmpMiddleW= _BmpRightW= _BmpH= 0;
_WMargin= 0;
_WMin= 0;
- _TextX= -2;
- _TextY= -2;
+ _TextX= 0;
+ _TextY= 0;
_Setuped= false;
_ViewText= NULL;
_IsViewTextId= false;
@@ -602,7 +602,7 @@ namespace NLGUI
_WMin= max(_WMin, _BmpLeftW + _BmpMiddleW + _BmpRightW);
// TextY
- _TextY= -2;
+ _TextY= 0;
prop = (char*) xmlGetProp( cur, (xmlChar*)"text_y" );
if (prop)
{
diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp
index 022347525..8c2ca96d3 100644
--- a/code/nel/src/gui/view_text.cpp
+++ b/code/nel/src/gui/view_text.cpp
@@ -2718,9 +2718,18 @@ namespace NLGUI
TextContext->setOblique (_Oblique);
// Letter size
- UTextContext::CStringInfo si = TextContext->getStringInfo(ucstring("|")); // for now we can't now that directly from UTextContext
- _FontHeight = (uint) si.StringHeight; // + (_Shadow?(_ShadowOutline?2:1):0);
- _FontLegHeight = (uint) si.StringLine; // + (_Shadow?(_ShadowOutline?2:1):0);
+ ucstring chars;
+ // instead of using the height of "|" that depends on font,
+ // we're using 2 characters:
+ // - "_" that should be the character with the lowest part
+ // - A with an accent for the highest part
+ chars.fromUtf8("_\xc3\x84");
+
+ // for now we can't know that directly from UTextContext
+ UTextContext::CStringInfo si = TextContext->getStringInfo(chars);
+ // add a padding of 1 pixel else the top will be truncated
+ _FontHeight = (uint) si.StringHeight+1;
+ _FontLegHeight = (uint) si.StringLine;
// Space width
si = TextContext->getStringInfo(ucstring(" "));
diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml b/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml
index f74967f41..d87dfb51b 100644
--- a/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml
+++ b/code/ryzom/client/data/gamedev/interfaces_v3/login_main.xml
@@ -41,13 +41,13 @@
-
-
-
-
+
+
@@ -297,7 +297,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
-
+
@@ -626,7 +626,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
-
+
@@ -647,8 +647,8 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
-
@@ -656,7 +656,7 @@ on_enter="leave_modal" options="no_bordure" mouse_pos="false" exit_key_pushed="t
-
-
-
diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml b/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml
index 9821bd34a..40f71f24e 100644
--- a/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml
+++ b/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml
@@ -63,7 +63,7 @@
-
-
-
@@ -385,7 +385,7 @@
-
-
-#include
// Client
#include "init.h"
#include "input.h"
@@ -578,14 +575,12 @@ void listStereoDisplayDevices(std::vector &devices)
IStereoDisplay::listDevices(devices);
for (std::vector::iterator it(devices.begin()), end(devices.end()); it != end; ++it)
{
- std::stringstream name;
- name << IStereoDisplay::getLibraryName(it->Library) << " - " << it->Manufacturer << " - " << it->ProductName;
- std::stringstream fullname;
- fullname << std::string("[") << name.str() << "] [" << it->Serial << "]";
- nlinfo("VR [C]: Stereo Display: %s", name.str().c_str());
+ std::string name = toString("%s - %s - %s", IStereoDisplay::getLibraryName(it->Library), it->Manufacturer.c_str(), it->ProductName.c_str());
+ std::string fullname = toString("[%s] [%s]", name.c_str(), it->Serial.c_str());
+ nlinfo("VR [C]: Stereo Display: %s", name.c_str());
if (cache)
{
- VRDeviceCache.push_back(std::pair(name.str(), it->Serial)); // VR_CONFIG
+ VRDeviceCache.push_back(std::pair(name, it->Serial)); // VR_CONFIG
}
}
}
@@ -623,9 +618,8 @@ void initStereoDisplayDevice()
{
for (std::vector::iterator it(devices.begin()), end(devices.end()); it != end; ++it)
{
- std::stringstream name;
- name << IStereoDisplay::getLibraryName(it->Library) << " - " << it->Manufacturer << " - " << it->ProductName;
- if (name.str() == ClientCfg.VRDisplayDevice)
+ std::string name = toString("%s - %s - %s", IStereoDisplay::getLibraryName(it->Library), it->Manufacturer.c_str(), it->ProductName.c_str());
+ if (name == ClientCfg.VRDisplayDevice)
deviceInfo = &(*it);
if (ClientCfg.VRDisplayDeviceId == it->Serial)
break;
diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp
index 445e95097..0204a57b0 100644
--- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp
+++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp
@@ -927,7 +927,7 @@ public:
CEntityCL *pSel = EntitiesMngr.entity(UserEntity->selection());
if (pSel != NULL)
if (pSel->isForageSource())
- UserEntity->moveToExtractionPhrase(UserEntity->selection(), 2.0f, ~0, ~0, true);
+ UserEntity->moveToExtractionPhrase(UserEntity->selection(), 2.0f, std::numeric_limits::max(), std::numeric_limits::max(), true);
}
}
};
diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp
index 47315f6ac..2167707c9 100644
--- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp
+++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp
@@ -862,11 +862,6 @@ OperationStep CConfigFile::getInstallNextStep() const
return CopyInstaller;
}
- if (m_shouldUninstallOldClient && !getSrcServerDirectory().isEmpty() && QFile::exists(getSrcServerDirectory() + "/Uninstall.exe"))
- {
- return UninstallOldClient;
- }
-
// no default profile
if (profile.id.isEmpty())
{
@@ -898,6 +893,11 @@ OperationStep CConfigFile::getInstallNextStep() const
if (!settings.contains("InstallLocation")) return CreateAddRemoveEntry;
#endif
+ if (m_shouldUninstallOldClient && !getSrcServerDirectory().isEmpty() && QFile::exists(getSrcServerDirectory() + "/Uninstall.exe"))
+ {
+ return UninstallOldClient;
+ }
+
return Done;
}
diff --git a/code/ryzom/tools/client/ryzom_installer/src/main.cpp b/code/ryzom/tools/client/ryzom_installer/src/main.cpp
index dfe588000..f46790110 100644
--- a/code/ryzom/tools/client/ryzom_installer/src/main.cpp
+++ b/code/ryzom/tools/client/ryzom_installer/src/main.cpp
@@ -61,23 +61,6 @@ int main(int argc, char *argv[])
QApplication::setApplicationVersion(RYZOM_VERSION);
QApplication::setWindowIcon(QIcon(":/icons/ryzom.ico"));
-#if defined(Q_OS_WIN) && !defined(_DEBUG)
- QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
-
- // check if launched from TEMP directory
- if (QApplication::applicationDirPath() != tempPath)
- {
- // copy installer and required files to TEMP directory
- if (copyInstallerExecutable(tempPath))
- {
- QString tempFile = tempPath + "/" + QFileInfo(QApplication::applicationFilePath()).fileName();
-
- // launch copy in TEMP directory with same arguments
- if (QProcess::startDetached(tempFile, QApplication::arguments())) return 0;
- }
- }
-#endif
-
QLocale locale = QLocale::system();
// load application translations
@@ -125,6 +108,23 @@ int main(int argc, char *argv[])
if (parser.isSet(uninstallOption))
{
+#if defined(Q_OS_WIN) && !defined(_DEBUG)
+ QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
+
+ // check if launched from TEMP directory
+ if (QApplication::applicationDirPath() != tempPath)
+ {
+ // copy installer and required files to TEMP directory
+ if (copyInstallerExecutable(tempPath))
+ {
+ QString tempFile = tempPath + "/" + QFileInfo(QApplication::applicationFilePath()).fileName();
+
+ // launch copy in TEMP directory with same arguments
+ if (QProcess::startDetached(tempFile, QApplication::arguments())) return 0;
+ }
+ }
+#endif
+
SComponents components;
// add all servers by default
diff --git a/code/ryzom/tools/client/ryzom_installer/src/operation.h b/code/ryzom/tools/client/ryzom_installer/src/operation.h
index 4e8b016be..5ea4326e1 100644
--- a/code/ryzom/tools/client/ryzom_installer/src/operation.h
+++ b/code/ryzom/tools/client/ryzom_installer/src/operation.h
@@ -38,12 +38,14 @@ struct SComponents
SComponents()
{
installer = true;
+ downloadedFiles = true;
}
QStringList servers;
QStringList profiles;
bool installer;
+ bool downloadedFiles;
};
enum OperationStep
diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp
index 617c5f613..c687a3df1 100644
--- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp
+++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp
@@ -243,11 +243,13 @@ void COperationDialog::updateAddRemoveComponents()
// update components to remove
m_removeComponents.profiles << profilesToDelete;
m_removeComponents.installer = false;
+ m_removeComponents.downloadedFiles = false;
// update components to add
m_addComponents.profiles << profilesToAdd;
m_addComponents.servers << serversToUpdate;
m_addComponents.installer = false;
+ m_addComponents.downloadedFiles = false;
}
void COperationDialog::processUpdateProfilesNextStep()
@@ -351,6 +353,10 @@ void COperationDialog::processUninstallNextStep()
{
QtConcurrent::run(this, &COperationDialog::deleteComponentsProfiles);
}
+ else if (m_removeComponents.downloadedFiles)
+ {
+ QtConcurrent::run(this, &COperationDialog::deleteComponentsDownloadedFiles);
+ }
else if (m_removeComponents.installer)
{
QtConcurrent::run(this, &COperationDialog::deleteComponentsInstaller);
@@ -1154,6 +1160,43 @@ void COperationDialog::deleteComponentsInstaller()
// TODO:
+ // reset it once it's done
+ m_removeComponents.installer = false;
+
+ emit onProgressSuccess(1);
+ emit done();
+}
+
+void COperationDialog::deleteComponentsDownloadedFiles()
+{
+ m_currentOperation = tr("Delete downloaded files");
+ m_currentOperationProgressFormat = tr("Deleting %1...");
+
+ CConfigFile *config = CConfigFile::getInstance();
+
+ QString path = config->getInstallationDirectory();
+
+ QDir dir(path);
+
+ QStringList filter;
+ filter << "*.7z";
+ filter << "*.bnp";
+ filter << "*.zip";
+ filter << "*.part";
+
+ QStringList files = dir.entryList(filter, QDir::Files);
+
+ foreach(const QString &file, files)
+ {
+ if (!QFile::remove(file))
+ {
+ qDebug() << "Unable to delete" << file;
+ }
+ }
+
+ // reset it once it's done
+ m_removeComponents.downloadedFiles = false;
+
emit onProgressSuccess(1);
emit done();
}
diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h
index bae2a8b7f..091b77278 100644
--- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h
+++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h
@@ -116,8 +116,8 @@ protected:
void addComponentsProfiles();
void deleteComponentsProfiles();
- void addComponentsInstaller();
void deleteComponentsInstaller();
+ void deleteComponentsDownloadedFiles();
void updateAddRemoveComponents();
diff --git a/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.cpp
index 4c61da6d5..a527e680a 100644
--- a/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.cpp
+++ b/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.cpp
@@ -79,7 +79,14 @@ CUninstallDialog::CUninstallDialog(QWidget *parent):QDialog(parent), m_installer
// installer
m_installerIndex = model->rowCount();
- item = new QStandardItem(tr("Ryzom Installer"));
+ item = new QStandardItem(tr("Installer"));
+ item->setCheckable(true);
+ model->appendRow(item);
+
+ // downloaded files
+ m_downloadedFilesIndex = model->rowCount();
+
+ item = new QStandardItem(tr("Downloaded Files"));
item->setCheckable(true);
model->appendRow(item);
@@ -148,6 +155,10 @@ void CUninstallDialog::setSelectedComponents(const SComponents &components)
// installer
item = model->item(m_installerIndex);
if (item) item->setCheckState(components.installer ? Qt::Checked : Qt::Unchecked);
+
+ // downloaded files
+ item = model->item(m_downloadedFilesIndex);
+ if (item) item->setCheckState(components.downloadedFiles ? Qt::Checked : Qt::Unchecked);
}
SComponents CUninstallDialog::getSelectedCompenents() const
@@ -187,6 +198,10 @@ SComponents CUninstallDialog::getSelectedCompenents() const
item = model->item(m_installerIndex);
res.installer = item && item->checkState() == Qt::Checked;
+ // downloaded files
+ item = model->item(m_downloadedFilesIndex);
+ res.downloadedFiles = item && item->checkState() == Qt::Checked;
+
return res;
}
diff --git a/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.h b/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.h
index f8bebace1..0c818ebc1 100644
--- a/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.h
+++ b/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.h
@@ -61,6 +61,7 @@ private:
IDIndicesMap m_profilesIndices;
int m_installerIndex;
+ int m_downloadedFilesIndex;
};
#endif