Merge branch 'master' of github.com:FreeCAD/FreeCAD
This commit is contained in:
@@ -1164,7 +1164,7 @@ void Application::initConfig(int argc, char ** argv)
|
||||
// Now it's time to read-in the file branding.xml if it exists
|
||||
Branding brand;
|
||||
QString binDir = QString::fromUtf8((mConfig["AppHomePath"] + "bin").c_str());
|
||||
QFileInfo fi(binDir, QString::fromAscii("branding.xml"));
|
||||
QFileInfo fi(binDir, QString::fromLatin1("branding.xml"));
|
||||
if (brand.readFile(fi.absoluteFilePath())) {
|
||||
Branding::XmlConfig cfg = brand.getUserDefines();
|
||||
for (Branding::XmlConfig::iterator it = cfg.begin(); it != cfg.end(); ++it) {
|
||||
|
||||
@@ -82,7 +82,7 @@ Branding::XmlConfig Branding::getUserDefines() const
|
||||
if (!root.isNull()) {
|
||||
child = root.firstChildElement();
|
||||
while (!child.isNull()) {
|
||||
std::string name = (const char*)child.localName().toAscii();
|
||||
std::string name = (const char*)child.localName().toLatin1();
|
||||
std::string value = (const char*)child.text().toUtf8();
|
||||
if (std::find(filter.begin(), filter.end(), name) != filter.end())
|
||||
cfg[name] = value;
|
||||
|
||||
@@ -161,6 +161,12 @@ protected:
|
||||
virtual void onChanged(const Property* prop) {
|
||||
FeatureT::onChanged(prop);
|
||||
}
|
||||
virtual void onDocumentRestored() {
|
||||
FeatureT::onDocumentRestored();
|
||||
}
|
||||
virtual void onSettingDocument() {
|
||||
FeatureT::onSettingDocument();
|
||||
}
|
||||
|
||||
private:
|
||||
DynamicProperty* props;
|
||||
|
||||
@@ -154,6 +154,35 @@ void FeaturePythonImp::onChanged(const Property* prop)
|
||||
}
|
||||
}
|
||||
|
||||
void FeaturePythonImp::onDocumentRestored()
|
||||
{
|
||||
// Run the execute method of the proxy object.
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Property* proxy = object->getPropertyByName("Proxy");
|
||||
if (proxy && proxy->getTypeId() == PropertyPythonObject::getClassTypeId()) {
|
||||
Py::Object feature = static_cast<PropertyPythonObject*>(proxy)->getValue();
|
||||
if (feature.hasAttr(std::string("onDocumentRestored"))) {
|
||||
if (feature.hasAttr("__object__")) {
|
||||
Py::Callable method(feature.getAttr(std::string("onDocumentRestored")));
|
||||
Py::Tuple args;
|
||||
method.apply(args);
|
||||
}
|
||||
else {
|
||||
Py::Callable method(feature.getAttr(std::string("onDocumentRestored")));
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(object->getPyObject(), true));
|
||||
method.apply(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
PyObject *FeaturePythonImp::getPyObject(void)
|
||||
{
|
||||
// ref counter is set to 1
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
bool execute();
|
||||
void onBeforeChange(const Property* prop);
|
||||
void onChanged(const Property* prop);
|
||||
void onDocumentRestored();
|
||||
PyObject *getPyObject(void);
|
||||
|
||||
private:
|
||||
@@ -200,6 +201,10 @@ protected:
|
||||
imp->onChanged(prop);
|
||||
FeatureT::onChanged(prop);
|
||||
}
|
||||
virtual void onDocumentRestored() {
|
||||
imp->onDocumentRestored();
|
||||
FeatureT::onDocumentRestored();
|
||||
}
|
||||
|
||||
private:
|
||||
FeaturePythonImp* imp;
|
||||
|
||||
+3
-3
@@ -70,9 +70,9 @@ public:
|
||||
/// Convert the path name into a UCS-2 encoded wide string format.
|
||||
std::wstring toStdWString() const;
|
||||
/** Returns the file's extension name.
|
||||
* If complete is TRUE (the default), extension() returns the string of all
|
||||
* If complete is true (the default), extension() returns the string of all
|
||||
* characters in the file name after (but not including) the first '.' character.
|
||||
* If complete is FALSE, extension() returns the string of all characters in
|
||||
* If complete is false, extension() returns the string of all characters in
|
||||
* the file name after (but not including) the last '.' character.
|
||||
* Example:
|
||||
*@code
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
|
||||
/** @name Directory management*/
|
||||
//@{
|
||||
/// Creates a directory. Returns TRUE if successful; otherwise returns FALSE.
|
||||
/// Creates a directory. Returns true if successful; otherwise returns false.
|
||||
bool createDirectory( void ) const;
|
||||
/// Get a list of the directory content
|
||||
std::vector<Base::FileInfo> getDirectoryContent(void) const;
|
||||
|
||||
@@ -107,16 +107,16 @@ bool BoundBox2D::Intersect(const Line2D &rclLine) const
|
||||
bool BoundBox2D::Intersect(const BoundBox2D &rclBB) const
|
||||
{
|
||||
//// compare bb2-points to this
|
||||
//if (Contains (Vector2D (rclBB.fMinX, rclBB.fMinY))) return TRUE;
|
||||
//if (Contains (Vector2D (rclBB.fMaxX, rclBB.fMinY))) return TRUE;
|
||||
//if (Contains (Vector2D (rclBB.fMaxX, rclBB.fMaxY))) return TRUE;
|
||||
//if (Contains (Vector2D (rclBB.fMinX, rclBB.fMaxY))) return TRUE;
|
||||
//if (Contains (Vector2D (rclBB.fMinX, rclBB.fMinY))) return true;
|
||||
//if (Contains (Vector2D (rclBB.fMaxX, rclBB.fMinY))) return true;
|
||||
//if (Contains (Vector2D (rclBB.fMaxX, rclBB.fMaxY))) return true;
|
||||
//if (Contains (Vector2D (rclBB.fMinX, rclBB.fMaxY))) return true;
|
||||
//
|
||||
//// compare this-points to bb2
|
||||
//if (rclBB.Contains (Vector2D (fMinX, fMinY))) return TRUE;
|
||||
//if (rclBB.Contains (Vector2D (fMaxX, fMinY))) return TRUE;
|
||||
//if (rclBB.Contains (Vector2D (fMaxX, fMaxY))) return TRUE;
|
||||
//if (rclBB.Contains (Vector2D (fMinX, fMaxY))) return TRUE;
|
||||
//if (rclBB.Contains (Vector2D (fMinX, fMinY))) return true;
|
||||
//if (rclBB.Contains (Vector2D (fMaxX, fMinY))) return true;
|
||||
//if (rclBB.Contains (Vector2D (fMaxX, fMaxY))) return true;
|
||||
//if (rclBB.Contains (Vector2D (fMinX, fMaxY))) return true;
|
||||
|
||||
if (fMinX < rclBB.fMaxX &&
|
||||
rclBB.fMinX < fMaxX &&
|
||||
@@ -222,7 +222,7 @@ bool Line2D::Intersect (const Line2D& rclLine, Vector2D &rclV) const
|
||||
rclV.fY = m1 * rclV.fX + b1;
|
||||
}
|
||||
|
||||
return true; /*** RETURN TRUE (intersection) **********/
|
||||
return true; /*** RETURN true (intersection) **********/
|
||||
}
|
||||
|
||||
bool Line2D::Intersect (const Vector2D &rclV, double eps) const
|
||||
|
||||
@@ -123,7 +123,7 @@ QString UnitsApi::schemaTranslate(Base::Quantity quant,double &factor,QString &u
|
||||
//{
|
||||
// return UserPrefSystem->toStrWithUserPrefs(t,Value);
|
||||
// //double UnitValue = Value/UserPrefFactor[t];
|
||||
// //return QString::fromAscii("%1 %2").arg(UnitValue).arg(UserPrefUnit[t]);
|
||||
// //return QString::fromLatin1("%1 %2").arg(UnitValue).arg(UserPrefUnit[t]);
|
||||
//}
|
||||
//
|
||||
//void UnitsApi::toStrWithUserPrefs(QuantityType t,double Value,QString &outValue,QString &outUnit)
|
||||
|
||||
+3
-3
@@ -68,21 +68,21 @@ std::string Uuid::createUuid(void)
|
||||
QString uuid = QUuid::createUuid().toString();
|
||||
uuid = uuid.mid(1);
|
||||
uuid.chop(1);
|
||||
Uuid = (const char*)uuid.toAscii();
|
||||
Uuid = (const char*)uuid.toLatin1();
|
||||
return Uuid;
|
||||
}
|
||||
|
||||
void Uuid::setValue(const char* sString)
|
||||
{
|
||||
if (sString) {
|
||||
QUuid uuid(QString::fromAscii(sString));
|
||||
QUuid uuid(QString::fromLatin1(sString));
|
||||
if (uuid.isNull())
|
||||
throw std::runtime_error("invalid uuid");
|
||||
// remove curly braces
|
||||
QString id = uuid.toString();
|
||||
id = id.mid(1);
|
||||
id.chop(1);
|
||||
_uuid = (const char*)id.toAscii();
|
||||
_uuid = (const char*)id.toLatin1();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -60,7 +60,7 @@ using namespace Gui::Dialog;
|
||||
Action::Action (Command* pcCmd, QObject * parent)
|
||||
: QObject(parent), _action(new QAction( this )), _pcCmd(pcCmd)
|
||||
{
|
||||
_action->setObjectName(QString::fromAscii(_pcCmd->getName()));
|
||||
_action->setObjectName(QString::fromLatin1(_pcCmd->getName()));
|
||||
connect(_action, SIGNAL(triggered(bool)), this, SLOT(onActivated()));
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ Action::Action (Command* pcCmd, QAction* action, QObject * parent)
|
||||
: QObject(parent), _action(action), _pcCmd(pcCmd)
|
||||
{
|
||||
_action->setParent(this);
|
||||
_action->setObjectName(QString::fromAscii(_pcCmd->getName()));
|
||||
_action->setObjectName(QString::fromLatin1(_pcCmd->getName()));
|
||||
connect(_action, SIGNAL(triggered(bool)), this, SLOT(onActivated()));
|
||||
}
|
||||
|
||||
@@ -589,7 +589,7 @@ void WorkbenchGroup::slotAddWorkbench(const char* name)
|
||||
QList<QAction*> workbenches = _group->actions();
|
||||
for (QList<QAction*>::Iterator it = workbenches.begin(); it != workbenches.end(); ++it) {
|
||||
if (!(*it)->isVisible()) {
|
||||
QString wb = QString::fromAscii(name);
|
||||
QString wb = QString::fromLatin1(name);
|
||||
QPixmap px = Application::Instance->workbenchIcon(wb);
|
||||
QString text = Application::Instance->workbenchMenuText(wb);
|
||||
QString tip = Application::Instance->workbenchToolTip(wb);
|
||||
@@ -606,7 +606,7 @@ void WorkbenchGroup::slotAddWorkbench(const char* name)
|
||||
|
||||
void WorkbenchGroup::slotRemoveWorkbench(const char* name)
|
||||
{
|
||||
QString workbench = QString::fromAscii(name);
|
||||
QString workbench = QString::fromLatin1(name);
|
||||
QList<QAction*> workbenches = _group->actions();
|
||||
for (QList<QAction*>::Iterator it = workbenches.begin(); it != workbenches.end(); ++it) {
|
||||
if ((*it)->objectName() == workbench) {
|
||||
@@ -668,7 +668,7 @@ void RecentFilesAction::setFiles(const QStringList& files)
|
||||
int numRecentFiles = std::min<int>(recentFiles.count(), files.count());
|
||||
for (int index = 0; index < numRecentFiles; index++) {
|
||||
QFileInfo fi(files[index]);
|
||||
recentFiles[index]->setText(QString::fromAscii("&%1 %2").arg(index+1).arg(fi.fileName()));
|
||||
recentFiles[index]->setText(QString::fromLatin1("&%1 %2").arg(index+1).arg(fi.fileName()));
|
||||
recentFiles[index]->setStatusTip(tr("Open file %1").arg(files[index]));
|
||||
recentFiles[index]->setToolTip(files[index]); // set the full name that we need later for saving
|
||||
recentFiles[index]->setData(QVariant(index));
|
||||
@@ -719,7 +719,7 @@ void RecentFilesAction::activateFile(int id)
|
||||
// invokes appendFile()
|
||||
SelectModule::Dict dict = SelectModule::importHandler(filename);
|
||||
for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) {
|
||||
Application::Instance->open(it.key().toUtf8(), it.value().toAscii());
|
||||
Application::Instance->open(it.key().toUtf8(), it.value().toLatin1());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -769,11 +769,11 @@ void RecentFilesAction::save()
|
||||
QList<QAction*> recentFiles = _group->actions();
|
||||
int num = std::min<int>(count, recentFiles.count());
|
||||
for (int index = 0; index < num; index++) {
|
||||
QString key = QString::fromAscii("MRU%1").arg(index);
|
||||
QString key = QString::fromLatin1("MRU%1").arg(index);
|
||||
QString value = recentFiles[index]->toolTip();
|
||||
if (value.isEmpty())
|
||||
break;
|
||||
hGrp->SetASCII(key.toAscii(), value.toUtf8());
|
||||
hGrp->SetASCII(key.toLatin1(), value.toUtf8());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+16
-16
@@ -336,7 +336,7 @@ Application::Application(bool GUIenabled)
|
||||
ParameterGrp::handle hPGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp");
|
||||
hPGrp = hPGrp->GetGroup("Preferences")->GetGroup("General");
|
||||
QString lang = QLocale::languageToString(QLocale::system().language());
|
||||
Translator::instance()->activateLanguage(hPGrp->GetASCII("Language", (const char*)lang.toAscii()).c_str());
|
||||
Translator::instance()->activateLanguage(hPGrp->GetASCII("Language", (const char*)lang.toLatin1()).c_str());
|
||||
GetWidgetFactorySupplier();
|
||||
|
||||
ParameterGrp::handle hUnits = App::GetApplication().GetParameterGroupByPath
|
||||
@@ -1050,7 +1050,7 @@ bool Application::activateWorkbench(const char* name)
|
||||
ok = true; // already active
|
||||
// now try to create and activate the matching workbench object
|
||||
else if (WorkbenchManager::instance()->activate(name, type)) {
|
||||
getMainWindow()->activateWorkbench(QString::fromAscii(name));
|
||||
getMainWindow()->activateWorkbench(QString::fromLatin1(name));
|
||||
this->signalActivateWorkbench(name);
|
||||
ok = true;
|
||||
}
|
||||
@@ -1095,7 +1095,7 @@ bool Application::activateWorkbench(const char* name)
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
QString msg = QString::fromAscii(e.what());
|
||||
QString msg = QString::fromLatin1(e.what());
|
||||
QRegExp rx;
|
||||
// ignore '<type 'exceptions.ImportError'>' prefixes
|
||||
rx.setPattern(QLatin1String("^\\s*<type 'exceptions.ImportError'>:\\s*"));
|
||||
@@ -1105,7 +1105,7 @@ bool Application::activateWorkbench(const char* name)
|
||||
pos = rx.indexIn(msg);
|
||||
}
|
||||
|
||||
Base::Console().Error("%s\n", (const char*)msg.toAscii());
|
||||
Base::Console().Error("%s\n", (const char*)msg.toLatin1());
|
||||
Base::Console().Log("%s\n", e.getStackTrace().c_str());
|
||||
if (!d->startingUp) {
|
||||
wc.restoreCursor();
|
||||
@@ -1122,7 +1122,7 @@ QPixmap Application::workbenchIcon(const QString& wb) const
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
// get the python workbench object from the dictionary
|
||||
PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toAscii());
|
||||
PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toLatin1());
|
||||
// test if the workbench exists
|
||||
if (pcWorkbench) {
|
||||
// make a unique icon name
|
||||
@@ -1196,7 +1196,7 @@ QString Application::workbenchToolTip(const QString& wb) const
|
||||
{
|
||||
// get the python workbench object from the dictionary
|
||||
Base::PyGILStateLocker lock;
|
||||
PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toAscii());
|
||||
PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toLatin1());
|
||||
// test if the workbench exists
|
||||
if (pcWorkbench) {
|
||||
// get its ToolTip member if possible
|
||||
@@ -1220,7 +1220,7 @@ QString Application::workbenchMenuText(const QString& wb) const
|
||||
{
|
||||
// get the python workbench object from the dictionary
|
||||
Base::PyGILStateLocker lock;
|
||||
PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toAscii());
|
||||
PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toLatin1());
|
||||
// test if the workbench exists
|
||||
if (pcWorkbench) {
|
||||
// get its ToolTip member if possible
|
||||
@@ -1251,13 +1251,13 @@ QStringList Application::workbenches(void) const
|
||||
const char* start = (st != config.end() ? st->second.c_str() : "<none>");
|
||||
QStringList hidden, extra;
|
||||
if (ht != config.end()) {
|
||||
QString items = QString::fromAscii(ht->second.c_str());
|
||||
QString items = QString::fromLatin1(ht->second.c_str());
|
||||
hidden = items.split(QLatin1Char(';'), QString::SkipEmptyParts);
|
||||
if (hidden.isEmpty())
|
||||
hidden.push_back(QLatin1String(""));
|
||||
}
|
||||
if (et != config.end()) {
|
||||
QString items = QString::fromAscii(et->second.c_str());
|
||||
QString items = QString::fromLatin1(et->second.c_str());
|
||||
extra = items.split(QLatin1Char(';'), QString::SkipEmptyParts);
|
||||
if (extra.isEmpty())
|
||||
extra.push_back(QLatin1String(""));
|
||||
@@ -1273,18 +1273,18 @@ QStringList Application::workbenches(void) const
|
||||
// add only allowed workbenches
|
||||
bool ok = true;
|
||||
if (!extra.isEmpty()&&ok) {
|
||||
ok = (extra.indexOf(QString::fromAscii(wbName)) != -1);
|
||||
ok = (extra.indexOf(QString::fromLatin1(wbName)) != -1);
|
||||
}
|
||||
if (!hidden.isEmpty()&&ok) {
|
||||
ok = (hidden.indexOf(QString::fromAscii(wbName)) == -1);
|
||||
ok = (hidden.indexOf(QString::fromLatin1(wbName)) == -1);
|
||||
}
|
||||
|
||||
// okay the item is visible
|
||||
if (ok)
|
||||
wb.push_back(QString::fromAscii(wbName));
|
||||
wb.push_back(QString::fromLatin1(wbName));
|
||||
// also allow start workbench in case it is hidden
|
||||
else if (strcmp(wbName, start) == 0)
|
||||
wb.push_back(QString::fromAscii(wbName));
|
||||
wb.push_back(QString::fromLatin1(wbName));
|
||||
}
|
||||
|
||||
return wb;
|
||||
@@ -1718,7 +1718,7 @@ void Application::runApplication(void)
|
||||
// if the auto workbench is not visible then force to use the default workbech
|
||||
// and replace the wrong entry in the parameters
|
||||
QStringList wb = app.workbenches();
|
||||
if (!wb.contains(QString::fromAscii(start.c_str()))) {
|
||||
if (!wb.contains(QString::fromLatin1(start.c_str()))) {
|
||||
start = App::Application::Config()["StartWorkbench"];
|
||||
App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")->
|
||||
SetASCII("AutoloadModule", start.c_str());
|
||||
@@ -1805,11 +1805,11 @@ void Application::runApplication(void)
|
||||
void Application::checkForPreviousCrashes()
|
||||
{
|
||||
QDir tmp = QString::fromUtf8(App::Application::getTempPath().c_str());
|
||||
tmp.setNameFilters(QStringList() << QString::fromAscii("*.lock"));
|
||||
tmp.setNameFilters(QStringList() << QString::fromLatin1("*.lock"));
|
||||
tmp.setFilter(QDir::Files);
|
||||
|
||||
QList<QFileInfo> restoreDocFiles;
|
||||
QString exeName = QString::fromAscii(App::GetApplication().getExecutableName());
|
||||
QString exeName = QString::fromLatin1(App::GetApplication().getExecutableName());
|
||||
QList<QFileInfo> locks = tmp.entryInfoList();
|
||||
for (QList<QFileInfo>::iterator it = locks.begin(); it != locks.end(); ++it) {
|
||||
QString bn = it->baseName();
|
||||
|
||||
+10
-10
@@ -84,8 +84,8 @@ BitmapFactoryInst& BitmapFactoryInst::instance(void)
|
||||
}
|
||||
_pcSingleton->addPath(path);
|
||||
}
|
||||
_pcSingleton->addPath(QString::fromAscii("%1/icons").arg(QString::fromUtf8(App::GetApplication().getHomePath())));
|
||||
_pcSingleton->addPath(QString::fromAscii("%1/icons").arg(QString::fromUtf8(App::GetApplication().Config()["UserAppData"].c_str())));
|
||||
_pcSingleton->addPath(QString::fromLatin1("%1/icons").arg(QString::fromUtf8(App::GetApplication().getHomePath())));
|
||||
_pcSingleton->addPath(QString::fromLatin1("%1/icons").arg(QString::fromUtf8(App::GetApplication().Config()["UserAppData"].c_str())));
|
||||
_pcSingleton->addPath(QLatin1String(":/icons/"));
|
||||
_pcSingleton->addPath(QLatin1String(":/Icons/"));
|
||||
|
||||
@@ -148,7 +148,7 @@ QStringList BitmapFactoryInst::findIconFiles() const
|
||||
QStringList files, filters;
|
||||
QList<QByteArray> formats = QImageReader::supportedImageFormats();
|
||||
for (QList<QByteArray>::iterator it = formats.begin(); it != formats.end(); ++it)
|
||||
filters << QString::fromAscii("*.%1").arg(QString::fromAscii(*it).toLower());
|
||||
filters << QString::fromLatin1("*.%1").arg(QString::fromLatin1(*it).toLower());
|
||||
|
||||
QStringList paths = QDir::searchPaths(QString::fromLatin1("icons"));
|
||||
#if QT_VERSION >= 0x040500
|
||||
@@ -252,8 +252,8 @@ QPixmap BitmapFactoryInst::pixmap(const char* name) const
|
||||
if (!loadPixmap(fileName, icon)) {
|
||||
// Go through supported file formats
|
||||
for (QList<QByteArray>::iterator fm = formats.begin(); fm != formats.end(); ++fm) {
|
||||
QString path = QString::fromAscii("%1.%2").arg(fileName).
|
||||
arg(QString::fromAscii((*fm).toLower().constData()));
|
||||
QString path = QString::fromLatin1("%1.%2").arg(fileName).
|
||||
arg(QString::fromLatin1((*fm).toLower().constData()));
|
||||
if (loadPixmap(path, icon)) {
|
||||
break;
|
||||
}
|
||||
@@ -316,8 +316,8 @@ QPixmap BitmapFactoryInst::pixmapFromSvg(const QByteArray& contents, const QSize
|
||||
QPalette pal = webView.palette();
|
||||
pal.setColor(QPalette::Background, Qt::transparent);
|
||||
webView.setPalette(pal);
|
||||
webView.setContent(contents, QString::fromAscii("image/svg+xml"));
|
||||
QString node = QString::fromAscii("document.rootElement.nodeName");
|
||||
webView.setContent(contents, QString::fromLatin1("image/svg+xml"));
|
||||
QString node = QString::fromLatin1("document.rootElement.nodeName");
|
||||
QWebFrame* frame = webView.page()->mainFrame();
|
||||
if (!frame) {
|
||||
return QPixmap();
|
||||
@@ -328,8 +328,8 @@ QPixmap BitmapFactoryInst::pixmapFromSvg(const QByteArray& contents, const QSize
|
||||
return QPixmap();
|
||||
}
|
||||
|
||||
QString w = QString::fromAscii("document.rootElement.width.baseVal.value");
|
||||
QString h = QString::fromAscii("document.rootElement.height.baseVal.value");
|
||||
QString w = QString::fromLatin1("document.rootElement.width.baseVal.value");
|
||||
QString h = QString::fromLatin1("document.rootElement.height.baseVal.value");
|
||||
double ww = frame->evaluateJavaScript(w).toDouble();
|
||||
double hh = frame->evaluateJavaScript(h).toDouble();
|
||||
if (ww == 0.0 || hh == 0.0)
|
||||
@@ -361,7 +361,7 @@ QPixmap BitmapFactoryInst::pixmapFromSvg(const QByteArray& contents, const QSize
|
||||
if (!frame) {
|
||||
return QPixmap();
|
||||
}
|
||||
frame->setContent(contents, QString::fromAscii("image/svg+xml"));
|
||||
frame->setContent(contents, QString::fromLatin1("image/svg+xml"));
|
||||
// Important to exclude user events here because otherwise
|
||||
// it may happen that an item the icon is created for gets
|
||||
// deleted in the meantime. This happens e.g. dragging over
|
||||
|
||||
@@ -53,7 +53,7 @@ using namespace Gui;
|
||||
|
||||
TYPESYSTEM_SOURCE(Gui::BlenderNavigationStyle, Gui::UserNavigationStyle);
|
||||
|
||||
BlenderNavigationStyle::BlenderNavigationStyle() : lockButton1(FALSE)
|
||||
BlenderNavigationStyle::BlenderNavigationStyle() : lockButton1(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -98,11 +98,11 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
|
||||
this->lastmouseposition = posn;
|
||||
|
||||
// Set to TRUE if any event processing happened. Note that it is not
|
||||
// Set to true if any event processing happened. Note that it is not
|
||||
// necessary to restrict ourselves to only do one "action" for an
|
||||
// event, we only need this flag to see if any processing happened
|
||||
// at all.
|
||||
SbBool processed = FALSE;
|
||||
SbBool processed = false;
|
||||
|
||||
const ViewerMode curmode = this->currentmode;
|
||||
ViewerMode newmode = curmode;
|
||||
@@ -123,13 +123,13 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (!processed && !viewer->isEditing()) {
|
||||
processed = handleEventInForeground(ev);
|
||||
if (processed)
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Keyboard handling
|
||||
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
switch (event->getKey()) {
|
||||
case SoKeyboardEvent::LEFT_CONTROL:
|
||||
case SoKeyboardEvent::RIGHT_CONTROL:
|
||||
@@ -144,7 +144,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
this->altdown = press;
|
||||
break;
|
||||
case SoKeyboardEvent::H:
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
viewer->saveHomePosition();
|
||||
break;
|
||||
case SoKeyboardEvent::S:
|
||||
@@ -165,37 +165,37 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||
const int button = event->getButton();
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
|
||||
//SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
||||
switch (button) {
|
||||
case SoMouseButtonEvent::BUTTON1:
|
||||
this->lockrecenter = TRUE;
|
||||
this->lockrecenter = true;
|
||||
this->button1down = press;
|
||||
if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
||||
newmode = NavigationStyle::SEEK_MODE;
|
||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
//else if (press && (this->currentmode == NavigationStyle::IDLE)) {
|
||||
// this->setViewing(true);
|
||||
// processed = TRUE;
|
||||
// processed = true;
|
||||
//}
|
||||
else if (press && (this->currentmode == NavigationStyle::PANNING ||
|
||||
this->currentmode == NavigationStyle::ZOOMING)) {
|
||||
newmode = NavigationStyle::DRAGGING;
|
||||
saveCursorPosition(ev);
|
||||
this->centerTime = ev->getTime();
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON2:
|
||||
// If we are in edit mode then simply ignore the RMB events
|
||||
// to pass the event to the base class.
|
||||
this->lockrecenter = TRUE;
|
||||
this->lockrecenter = true;
|
||||
if (!viewer->isEditing()) {
|
||||
// If we are in zoom or pan mode ignore RMB events otherwise
|
||||
// the canvas doesn't get any release events
|
||||
@@ -215,7 +215,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
newmode = NavigationStyle::DRAGGING;
|
||||
saveCursorPosition(ev);
|
||||
this->centerTime = ev->getTime();
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
this->button2down = press;
|
||||
break;
|
||||
@@ -225,7 +225,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
||||
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
||||
this->lockrecenter = FALSE;
|
||||
this->lockrecenter = false;
|
||||
}
|
||||
else {
|
||||
SbTime tmp = (ev->getTime() - this->centerTime);
|
||||
@@ -236,18 +236,18 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
panToCenter(panningplane, posn);
|
||||
this->interactiveCountDec();
|
||||
}
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
this->button3down = press;
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON4:
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
||||
processed = TRUE;
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||
processed = true;
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON5:
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
||||
processed = TRUE;
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||
processed = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -256,22 +256,22 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
|
||||
// Mouse Movement handling
|
||||
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
||||
this->lockrecenter = TRUE;
|
||||
this->lockrecenter = true;
|
||||
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
||||
if (this->currentmode == NavigationStyle::ZOOMING) {
|
||||
this->zoomByCursor(posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (this->currentmode == NavigationStyle::PANNING) {
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
||||
this->addToLog(event->getPosition(), event->getTime());
|
||||
this->spin(posn);
|
||||
moveCursorPosition();
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||
if (event)
|
||||
this->processMotionEvent(event);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
|
||||
enum {
|
||||
@@ -304,8 +304,8 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
// The left mouse button has been released right now but
|
||||
// we want to avoid that the event is procesed elsewhere
|
||||
if (this->lockButton1) {
|
||||
this->lockButton1 = FALSE;
|
||||
processed = TRUE;
|
||||
this->lockButton1 = false;
|
||||
processed = true;
|
||||
}
|
||||
|
||||
//if (curmode == NavigationStyle::DRAGGING) {
|
||||
@@ -351,14 +351,14 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
// but then button 3 is relaesed we shouldn't switch
|
||||
// into selection mode.
|
||||
if (this->button1down && this->button3down)
|
||||
this->lockButton1 = TRUE;
|
||||
this->lockButton1 = true;
|
||||
|
||||
// If not handled in this class, pass on upwards in the inheritance
|
||||
// hierarchy.
|
||||
if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed)
|
||||
processed = inherited::processSoEvent(ev);
|
||||
else
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return processed;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ using namespace Gui;
|
||||
|
||||
TYPESYSTEM_SOURCE(Gui::CADNavigationStyle, Gui::UserNavigationStyle);
|
||||
|
||||
CADNavigationStyle::CADNavigationStyle() : lockButton1(FALSE)
|
||||
CADNavigationStyle::CADNavigationStyle() : lockButton1(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -102,11 +102,11 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
|
||||
this->lastmouseposition = posn;
|
||||
|
||||
// Set to TRUE if any event processing happened. Note that it is not
|
||||
// Set to true if any event processing happened. Note that it is not
|
||||
// necessary to restrict ourselves to only do one "action" for an
|
||||
// event, we only need this flag to see if any processing happened
|
||||
// at all.
|
||||
SbBool processed = FALSE;
|
||||
SbBool processed = false;
|
||||
|
||||
const ViewerMode curmode = this->currentmode;
|
||||
ViewerMode newmode = curmode;
|
||||
@@ -127,13 +127,13 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (!processed && !viewer->isEditing()) {
|
||||
processed = handleEventInForeground(ev);
|
||||
if (processed)
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Keyboard handling
|
||||
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
switch (event->getKey()) {
|
||||
case SoKeyboardEvent::LEFT_CONTROL:
|
||||
case SoKeyboardEvent::RIGHT_CONTROL:
|
||||
@@ -148,7 +148,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
this->altdown = press;
|
||||
break;
|
||||
case SoKeyboardEvent::H:
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
viewer->saveHomePosition();
|
||||
break;
|
||||
case SoKeyboardEvent::S:
|
||||
@@ -169,12 +169,12 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||
const int button = event->getButton();
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
|
||||
// SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
||||
switch (button) {
|
||||
case SoMouseButtonEvent::BUTTON1:
|
||||
this->lockrecenter = TRUE;
|
||||
this->lockrecenter = true;
|
||||
this->button1down = press;
|
||||
#if 0 // disable to avoid interferences where this key combination is used, too
|
||||
if (press && ev->wasShiftDown() &&
|
||||
@@ -183,7 +183,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
SbViewVolume vv = viewer->getCamera()->getViewVolume(ratio);
|
||||
this->panningplane = vv.getPlane(viewer->getCamera()->focalDistance.getValue());
|
||||
this->lockrecenter = FALSE;
|
||||
this->lockrecenter = false;
|
||||
}
|
||||
else if (!press && ev->wasShiftDown() &&
|
||||
(this->currentmode != NavigationStyle::SELECTION)) {
|
||||
@@ -195,7 +195,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
panToCenter(panningplane, posn);
|
||||
this->interactiveCountDec();
|
||||
}
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -203,18 +203,18 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
||||
newmode = NavigationStyle::SEEK_MODE;
|
||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
//else if (press && (this->currentmode == NavigationStyle::IDLE)) {
|
||||
// this->setViewing(true);
|
||||
// processed = TRUE;
|
||||
// processed = true;
|
||||
//}
|
||||
else if (press && (this->currentmode == NavigationStyle::PANNING ||
|
||||
this->currentmode == NavigationStyle::ZOOMING)) {
|
||||
newmode = NavigationStyle::DRAGGING;
|
||||
saveCursorPosition(ev);
|
||||
this->centerTime = ev->getTime();
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
||||
SbTime tmp = (ev->getTime() - this->centerTime);
|
||||
@@ -222,16 +222,16 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (tmp.getValue() < dci) {
|
||||
newmode = NavigationStyle::ZOOMING;
|
||||
}
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON2:
|
||||
// If we are in edit mode then simply ignore the RMB events
|
||||
// to pass the event to the base class.
|
||||
this->lockrecenter = TRUE;
|
||||
this->lockrecenter = true;
|
||||
if (!viewer->isEditing()) {
|
||||
// If we are in zoom or pan mode ignore RMB events otherwise
|
||||
// the canvas doesn't get any release events
|
||||
@@ -251,7 +251,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
newmode = NavigationStyle::DRAGGING;
|
||||
saveCursorPosition(ev);
|
||||
this->centerTime = ev->getTime();
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
||||
SbTime tmp = (ev->getTime() - this->centerTime);
|
||||
@@ -259,7 +259,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (tmp.getValue() < dci) {
|
||||
newmode = NavigationStyle::ZOOMING;
|
||||
}
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
this->button2down = press;
|
||||
break;
|
||||
@@ -269,7 +269,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
||||
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
||||
this->lockrecenter = FALSE;
|
||||
this->lockrecenter = false;
|
||||
}
|
||||
else {
|
||||
SbTime tmp = (ev->getTime() - this->centerTime);
|
||||
@@ -280,18 +280,18 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
panToCenter(panningplane, posn);
|
||||
this->interactiveCountDec();
|
||||
}
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
this->button3down = press;
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON4:
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
||||
processed = TRUE;
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||
processed = true;
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON5:
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
||||
processed = TRUE;
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||
processed = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -300,22 +300,22 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
|
||||
// Mouse Movement handling
|
||||
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
||||
this->lockrecenter = TRUE;
|
||||
this->lockrecenter = true;
|
||||
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
||||
if (this->currentmode == NavigationStyle::ZOOMING) {
|
||||
this->zoomByCursor(posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (this->currentmode == NavigationStyle::PANNING) {
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
||||
this->addToLog(event->getPosition(), event->getTime());
|
||||
this->spin(posn);
|
||||
moveCursorPosition();
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||
if (event)
|
||||
this->processMotionEvent(event);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
|
||||
enum {
|
||||
@@ -348,8 +348,8 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
// The left mouse button has been released right now but
|
||||
// we want to avoid that the event is procesed elsewhere
|
||||
if (this->lockButton1) {
|
||||
this->lockButton1 = FALSE;
|
||||
processed = TRUE;
|
||||
this->lockButton1 = false;
|
||||
processed = true;
|
||||
}
|
||||
|
||||
//if (curmode == NavigationStyle::DRAGGING) {
|
||||
@@ -424,14 +424,14 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
// but then button 3 is relaesed we shouldn't switch
|
||||
// into selection mode.
|
||||
if (this->button1down && this->button3down)
|
||||
this->lockButton1 = TRUE;
|
||||
this->lockButton1 = true;
|
||||
|
||||
// If not handled in this class, pass on upwards in the inheritance
|
||||
// hierarchy.
|
||||
if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed)
|
||||
processed = inherited::processSoEvent(ev);
|
||||
else
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return processed;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ QString CallTipsList::extractContext(const QString& line) const
|
||||
int index = len-1;
|
||||
for (int i=0; i<len; i++) {
|
||||
int pos = len-1-i;
|
||||
const char ch = line.at(pos).toAscii();
|
||||
const char ch = line.at(pos).toLatin1();
|
||||
if ((ch >= 48 && ch <= 57) || // Numbers
|
||||
(ch >= 65 && ch <= 90) || // Uppercase letters
|
||||
(ch >= 97 && ch <= 122) || // Lowercase letters
|
||||
@@ -208,13 +208,13 @@ QMap<QString, CallTip> CallTipsList::extractTips(const QString& context) const
|
||||
Py::Dict dict = module.getDict();
|
||||
QString modname = items.front();
|
||||
items.pop_front();
|
||||
if (!dict.hasKey(std::string(modname.toAscii())))
|
||||
if (!dict.hasKey(std::string(modname.toLatin1())))
|
||||
return tips; // unknown object
|
||||
|
||||
// get the Python object we need
|
||||
Py::Object obj = dict.getItem(std::string(modname.toAscii()));
|
||||
Py::Object obj = dict.getItem(std::string(modname.toLatin1()));
|
||||
while (!items.isEmpty()) {
|
||||
QByteArray name = items.front().toAscii();
|
||||
QByteArray name = items.front().toLatin1();
|
||||
std::string attr = name.constData();
|
||||
items.pop_front();
|
||||
if (obj.hasAttr(attr))
|
||||
@@ -321,7 +321,7 @@ void CallTipsList::extractTipsFromObject(Py::Object& obj, Py::List& list, QMap<Q
|
||||
Py::Object attr = obj.getAttr(attrname.as_string());
|
||||
|
||||
CallTip tip;
|
||||
QString str = QString::fromAscii(attrname.as_string().c_str());
|
||||
QString str = QString::fromLatin1(attrname.as_string().c_str());
|
||||
tip.name = str;
|
||||
|
||||
if (attr.isCallable()) {
|
||||
@@ -387,7 +387,7 @@ void CallTipsList::extractTipsFromProperties(Py::Object& obj, QMap<QString, Call
|
||||
|
||||
for (std::map<std::string,App::Property*>::const_iterator It=Map.begin();It!=Map.end();++It) {
|
||||
CallTip tip;
|
||||
QString str = QString::fromAscii(It->first.c_str());
|
||||
QString str = QString::fromLatin1(It->first.c_str());
|
||||
tip.name = str;
|
||||
tip.type = CallTip::Property;
|
||||
QString longdoc = QString::fromUtf8(container->getPropertyDocumentation(It->second));
|
||||
|
||||
+4
-4
@@ -623,7 +623,7 @@ const char* Command::keySequenceToAccel(int sk) const
|
||||
QKeySequence::StandardKey type = (QKeySequence::StandardKey)sk;
|
||||
QKeySequence ks(type);
|
||||
QString qs = ks.toString();
|
||||
QByteArray data = qs.toAscii();
|
||||
QByteArray data = qs.toLatin1();
|
||||
#if defined (_MSC_VER)
|
||||
return _strdup((const char*)data);
|
||||
#else
|
||||
@@ -676,7 +676,7 @@ Action * Command::createAction(void)
|
||||
Action *pcAction;
|
||||
|
||||
pcAction = new Action(this,getMainWindow());
|
||||
pcAction->setShortcut(QString::fromAscii(sAccel));
|
||||
pcAction->setShortcut(QString::fromLatin1(sAccel));
|
||||
applyCommandData(this->className(), pcAction);
|
||||
if (sPixmap)
|
||||
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(sPixmap));
|
||||
@@ -751,7 +751,7 @@ Action * MacroCommand::createAction(void)
|
||||
pcAction->setWhatsThis(QString::fromUtf8(sWhatsThis));
|
||||
if (sPixmap)
|
||||
pcAction->setIcon(Gui::BitmapFactory().pixmap(sPixmap));
|
||||
pcAction->setShortcut(QString::fromAscii(sAccel));
|
||||
pcAction->setShortcut(QString::fromLatin1(sAccel));
|
||||
|
||||
QString accel = pcAction->shortcut().toString(QKeySequence::NativeText);
|
||||
if (!accel.isEmpty()) {
|
||||
@@ -959,7 +959,7 @@ Action * PythonCommand::createAction(void)
|
||||
Action *pcAction;
|
||||
|
||||
pcAction = new Action(this, qtAction, getMainWindow());
|
||||
pcAction->setShortcut(QString::fromAscii(getAccel()));
|
||||
pcAction->setShortcut(QString::fromLatin1(getAccel()));
|
||||
applyCommandData(this->getName(), pcAction);
|
||||
if (strcmp(getResource("Pixmap"),"") != 0)
|
||||
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(getResource("Pixmap")));
|
||||
|
||||
@@ -145,7 +145,7 @@ void StdCmdOpen::activated(int iMsg)
|
||||
}
|
||||
else {
|
||||
for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) {
|
||||
getGuiApplication()->open(it.key().toUtf8(), it.value().toAscii());
|
||||
getGuiApplication()->open(it.key().toUtf8(), it.value().toLatin1());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ void StdCmdImport::activated(int iMsg)
|
||||
for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) {
|
||||
getGuiApplication()->importFrom(it.key().toUtf8(),
|
||||
getActiveGuiDocument()->getDocument()->getName(),
|
||||
it.value().toAscii());
|
||||
it.value().toLatin1());
|
||||
}
|
||||
|
||||
if (emptyDoc) {
|
||||
@@ -288,7 +288,7 @@ void StdCmdExport::activated(int iMsg)
|
||||
for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) {
|
||||
getGuiApplication()->exportTo(it.key().toUtf8(),
|
||||
getActiveGuiDocument()->getDocument()->getName(),
|
||||
it.value().toAscii());
|
||||
it.value().toLatin1());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -397,7 +397,7 @@ StdCmdNew::StdCmdNew()
|
||||
void StdCmdNew::activated(int iMsg)
|
||||
{
|
||||
QString cmd;
|
||||
cmd = QString::fromAscii("App.newDocument(\"%1\")")
|
||||
cmd = QString::fromLatin1("App.newDocument(\"%1\")")
|
||||
.arg(qApp->translate("StdCmdNew","Unnamed"));
|
||||
doCommand(Command::Doc,(const char*)cmd.toUtf8());
|
||||
}
|
||||
@@ -752,7 +752,7 @@ Action * StdCmdUndo::createAction(void)
|
||||
Action *pcAction;
|
||||
|
||||
pcAction = new UndoAction(this,getMainWindow());
|
||||
pcAction->setShortcut(QString::fromAscii(sAccel));
|
||||
pcAction->setShortcut(QString::fromLatin1(sAccel));
|
||||
applyCommandData(this->className(), pcAction);
|
||||
if (sPixmap)
|
||||
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(sPixmap));
|
||||
@@ -795,7 +795,7 @@ Action * StdCmdRedo::createAction(void)
|
||||
Action *pcAction;
|
||||
|
||||
pcAction = new RedoAction(this,getMainWindow());
|
||||
pcAction->setShortcut(QString::fromAscii(sAccel));
|
||||
pcAction->setShortcut(QString::fromLatin1(sAccel));
|
||||
applyCommandData(this->className(), pcAction);
|
||||
if (sPixmap)
|
||||
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(sPixmap));
|
||||
|
||||
@@ -90,7 +90,7 @@ void StdCmdWorkbench::activated(int i)
|
||||
try {
|
||||
Workbench* w = WorkbenchManager::instance()->active();
|
||||
QList<QAction*> items = static_cast<WorkbenchGroup*>(_pcAction)->actions();
|
||||
std::string switch_to = (const char*)items[i]->objectName().toAscii();
|
||||
std::string switch_to = (const char*)items[i]->objectName().toLatin1();
|
||||
if (w) {
|
||||
std::string current_w = w->name();
|
||||
if (switch_to == current_w)
|
||||
@@ -124,7 +124,7 @@ Action * StdCmdWorkbench::createAction(void)
|
||||
Action *pcAction;
|
||||
|
||||
pcAction = new WorkbenchGroup(this,getMainWindow());
|
||||
pcAction->setShortcut(QString::fromAscii(sAccel));
|
||||
pcAction->setShortcut(QString::fromLatin1(sAccel));
|
||||
applyCommandData(this->className(), pcAction);
|
||||
if (sPixmap)
|
||||
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(sPixmap));
|
||||
@@ -206,7 +206,7 @@ Action * StdCmdAbout::createAction(void)
|
||||
QCoreApplication::CodecForTr).arg(exe));
|
||||
pcAction->setWhatsThis(QLatin1String(sWhatsThis));
|
||||
pcAction->setIcon(QApplication::windowIcon());
|
||||
pcAction->setShortcut(QString::fromAscii(sAccel));
|
||||
pcAction->setShortcut(QString::fromLatin1(sAccel));
|
||||
//Prevent Qt from using AboutRole -- fixes issue #0001485
|
||||
pcAction->setMenuRole(QAction::ApplicationSpecificRole);
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@ Std_TestQM::Std_TestQM()
|
||||
void Std_TestQM::activated(int iMsg)
|
||||
{
|
||||
QStringList files = QFileDialog::getOpenFileNames(getMainWindow(),
|
||||
QString::fromAscii("Test translation"), QString(),
|
||||
QString::fromAscii("Translation (*.qm)"));
|
||||
QString::fromLatin1("Test translation"), QString(),
|
||||
QString::fromLatin1("Translation (*.qm)"));
|
||||
if (!files.empty()) {
|
||||
Translator::instance()->activateLanguage("English");
|
||||
QList<QTranslator*> i18n = qApp->findChildren<QTranslator*>();
|
||||
|
||||
+21
-21
@@ -229,17 +229,17 @@ Action * StdCmdFreezeViews::createAction(void)
|
||||
// add the action items
|
||||
saveView = pcAction->addAction(QObject::tr("Save views..."));
|
||||
pcAction->addAction(QObject::tr("Load views..."));
|
||||
pcAction->addAction(QString::fromAscii(""))->setSeparator(true);
|
||||
pcAction->addAction(QString::fromLatin1(""))->setSeparator(true);
|
||||
freezeView = pcAction->addAction(QObject::tr("Freeze view"));
|
||||
freezeView->setShortcut(QString::fromAscii(sAccel));
|
||||
freezeView->setShortcut(QString::fromLatin1(sAccel));
|
||||
clearView = pcAction->addAction(QObject::tr("Clear views"));
|
||||
separator = pcAction->addAction(QString::fromAscii(""));
|
||||
separator = pcAction->addAction(QString::fromLatin1(""));
|
||||
separator->setSeparator(true);
|
||||
offset = pcAction->actions().count();
|
||||
|
||||
// allow up to 50 views
|
||||
for (int i=0; i<maxViews; i++)
|
||||
pcAction->addAction(QString::fromAscii(""))->setVisible(false);
|
||||
pcAction->addAction(QString::fromLatin1(""))->setVisible(false);
|
||||
|
||||
return pcAction;
|
||||
}
|
||||
@@ -266,7 +266,7 @@ void StdCmdFreezeViews::activated(int iMsg)
|
||||
savedViews++;
|
||||
QString viewnr = QString(QObject::tr("Restore view &%1")).arg(index+1);
|
||||
(*it)->setText(viewnr);
|
||||
(*it)->setToolTip(QString::fromAscii(ppReturn));
|
||||
(*it)->setToolTip(QString::fromLatin1(ppReturn));
|
||||
(*it)->setVisible(true);
|
||||
if (index < 9) {
|
||||
int accel = Qt::CTRL+Qt::Key_1;
|
||||
@@ -286,8 +286,8 @@ void StdCmdFreezeViews::activated(int iMsg)
|
||||
// Activate a view
|
||||
QList<QAction*> acts = pcAction->actions();
|
||||
QString data = acts[iMsg]->toolTip();
|
||||
QString send = QString::fromAscii("SetCamera %1").arg(data);
|
||||
getGuiApplication()->sendMsgToActiveView(send.toAscii());
|
||||
QString send = QString::fromLatin1("SetCamera %1").arg(data);
|
||||
getGuiApplication()->sendMsgToActiveView(send.toLatin1());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,14 +316,14 @@ void StdCmdFreezeViews::onSaveViews()
|
||||
// remove the first line because it's a comment like '#Inventor V2.1 ascii'
|
||||
QString viewPos;
|
||||
if ( !data.isEmpty() ) {
|
||||
QStringList lines = data.split(QString::fromAscii("\n"));
|
||||
QStringList lines = data.split(QString::fromLatin1("\n"));
|
||||
if ( lines.size() > 1 ) {
|
||||
lines.pop_front();
|
||||
viewPos = lines.join(QString::fromAscii(" "));
|
||||
viewPos = lines.join(QString::fromLatin1(" "));
|
||||
}
|
||||
}
|
||||
|
||||
str << " <Camera settings=\"" << viewPos.toAscii().constData() << "\"/>" << endl;
|
||||
str << " <Camera settings=\"" << viewPos.toLatin1().constData() << "\"/>" << endl;
|
||||
}
|
||||
|
||||
str << " </Views>" << endl;
|
||||
@@ -364,7 +364,7 @@ void StdCmdFreezeViews::onRestoreViews()
|
||||
if (!xmlDocument.setContent(&file, true, &errorStr, &errorLine, &errorColumn)) {
|
||||
std::cerr << "Parse error in XML content at line " << errorLine
|
||||
<< ", column " << errorColumn << ": "
|
||||
<< (const char*)errorStr.toAscii() << std::endl;
|
||||
<< (const char*)errorStr.toLatin1() << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -376,18 +376,18 @@ void StdCmdFreezeViews::onRestoreViews()
|
||||
}
|
||||
|
||||
bool ok;
|
||||
int scheme = root.attribute(QString::fromAscii("SchemaVersion")).toInt(&ok);
|
||||
int scheme = root.attribute(QString::fromLatin1("SchemaVersion")).toInt(&ok);
|
||||
if (!ok) return;
|
||||
// SchemeVersion "1"
|
||||
if (scheme == 1) {
|
||||
// read the views, ignore the attribute 'Count'
|
||||
QDomElement child = root.firstChildElement(QString::fromAscii("Views"));
|
||||
QDomElement views = child.firstChildElement(QString::fromAscii("Camera"));
|
||||
QDomElement child = root.firstChildElement(QString::fromLatin1("Views"));
|
||||
QDomElement views = child.firstChildElement(QString::fromLatin1("Camera"));
|
||||
QStringList cameras;
|
||||
while (!views.isNull()) {
|
||||
QString setting = views.attribute(QString::fromAscii("settings"));
|
||||
QString setting = views.attribute(QString::fromLatin1("settings"));
|
||||
cameras << setting;
|
||||
views = views.nextSiblingElement(QString::fromAscii("Camera"));
|
||||
views = views.nextSiblingElement(QString::fromLatin1("Camera"));
|
||||
}
|
||||
|
||||
// use this rather than the attribute 'Count' because it could be
|
||||
@@ -1468,12 +1468,12 @@ void StdViewScreenShot::activated(int iMsg)
|
||||
|
||||
Base::Reference<ParameterGrp> hExt = App::GetApplication().GetUserParameter().GetGroup("BaseApp")
|
||||
->GetGroup("Preferences")->GetGroup("General");
|
||||
QString ext = QString::fromAscii(hExt->GetASCII("OffscreenImageFormat").c_str());
|
||||
QString ext = QString::fromLatin1(hExt->GetASCII("OffscreenImageFormat").c_str());
|
||||
|
||||
QStringList filter;
|
||||
QString selFilter;
|
||||
for (QStringList::Iterator it = formats.begin(); it != formats.end(); ++it) {
|
||||
filter << QString::fromAscii("%1 %2 (*.%3)").arg((*it).toUpper()).
|
||||
filter << QString::fromLatin1("%1 %2 (*.%3)").arg((*it).toUpper()).
|
||||
arg(QObject::tr("files")).arg((*it).toLower());
|
||||
if (ext == *it)
|
||||
selFilter = filter.last();
|
||||
@@ -1520,7 +1520,7 @@ void StdViewScreenShot::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
hExt->SetASCII("OffscreenImageFormat", (const char*)format.toAscii());
|
||||
hExt->SetASCII("OffscreenImageFormat", (const char*)format.toLatin1());
|
||||
|
||||
// which background chosen
|
||||
const char* background;
|
||||
@@ -2147,7 +2147,7 @@ static void selectionCallback(void * ud, SoEventCallback * cb)
|
||||
Gui::View3DInventorViewer* view = reinterpret_cast<Gui::View3DInventorViewer*>(cb->getUserData());
|
||||
view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback, ud);
|
||||
SoNode* root = view->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(TRUE);
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(true);
|
||||
|
||||
std::vector<SbVec2f> picked = view->getGLPolygon();
|
||||
SoCamera* cam = view->getSoRenderManager()->getCamera();
|
||||
@@ -2202,7 +2202,7 @@ void StdBoxSelection::activated(int iMsg)
|
||||
viewer->startSelection(View3DInventorViewer::Rubberband);
|
||||
viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), selectionCallback);
|
||||
SoNode* root = viewer->getSceneGraph();
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(FALSE);
|
||||
static_cast<Gui::SoFCUnifiedSelection*>(root)->selectionRole.setValue(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ using namespace Gui::Dialog;
|
||||
|
||||
/* TRANSLATOR Gui::Dialog::DemoMode */
|
||||
|
||||
DemoMode::DemoMode(QWidget* parent, Qt::WFlags fl)
|
||||
DemoMode::DemoMode(QWidget* parent, Qt::WindowFlags fl)
|
||||
: QDialog(0, fl|Qt::WindowStaysOnTopHint), viewAxis(0,0,-1), ui(new Ui_DemoMode)
|
||||
{
|
||||
// create widgets
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ class GuiExport DemoMode : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DemoMode(QWidget* parent = 0, Qt::WFlags fl = 0);
|
||||
DemoMode(QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
~DemoMode();
|
||||
|
||||
void accept();
|
||||
|
||||
+10
-10
@@ -53,7 +53,7 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgCustomActionsImp::DlgCustomActionsImp( QWidget* parent )
|
||||
: CustomizeActionPage(parent), bShown( false )
|
||||
@@ -198,7 +198,7 @@ void DlgCustomActionsImp::on_actionListWidget_itemActivated(QTreeWidgetItem *ite
|
||||
actionMenu -> setText(QString::fromUtf8(pScript->getMenuText()));
|
||||
actionToolTip -> setText(QString::fromUtf8(pScript->getToolTipText()));
|
||||
actionStatus -> setText(QString::fromUtf8(pScript->getStatusTip()));
|
||||
actionAccel -> setText(QString::fromAscii(pScript->getAccel()));
|
||||
actionAccel -> setText(QString::fromLatin1(pScript->getAccel()));
|
||||
pixmapLabel->clear();
|
||||
m_sPixmap = QString::null;
|
||||
const char* name = pScript->getPixmap();
|
||||
@@ -226,7 +226,7 @@ void DlgCustomActionsImp::on_buttonAddAction_clicked()
|
||||
}
|
||||
|
||||
// search for the command in the manager
|
||||
QByteArray actionName = newActionName().toAscii();
|
||||
QByteArray actionName = newActionName().toLatin1();
|
||||
CommandManager& rclMan = Application::Instance->commandManager();
|
||||
MacroCommand* macro = new MacroCommand(actionName);
|
||||
rclMan.addCommand( macro );
|
||||
@@ -260,12 +260,12 @@ void DlgCustomActionsImp::on_buttonAddAction_clicked()
|
||||
actionStatus->clear();
|
||||
|
||||
if (!m_sPixmap.isEmpty())
|
||||
macro->setPixmap(m_sPixmap.toAscii());
|
||||
macro->setPixmap(m_sPixmap.toLatin1());
|
||||
pixmapLabel->clear();
|
||||
m_sPixmap = QString::null;
|
||||
|
||||
if (!actionAccel->text().isEmpty()) {
|
||||
macro->setAccel(actionAccel->text().toAscii());
|
||||
macro->setAccel(actionAccel->text().toLatin1());
|
||||
}
|
||||
actionAccel->clear();
|
||||
|
||||
@@ -315,12 +315,12 @@ void DlgCustomActionsImp::on_buttonReplaceAction_clicked()
|
||||
actionStatus->clear();
|
||||
|
||||
if (!m_sPixmap.isEmpty())
|
||||
macro->setPixmap(m_sPixmap.toAscii());
|
||||
macro->setPixmap(m_sPixmap.toLatin1());
|
||||
pixmapLabel->clear();
|
||||
m_sPixmap = QString::null;
|
||||
|
||||
if (!actionAccel->text().isEmpty()) {
|
||||
macro->setAccel(actionAccel->text().toAscii());
|
||||
macro->setAccel(actionAccel->text().toLatin1());
|
||||
}
|
||||
actionAccel->clear();
|
||||
|
||||
@@ -335,7 +335,7 @@ void DlgCustomActionsImp::on_buttonReplaceAction_clicked()
|
||||
action->setStatusTip(QString::fromUtf8(macro->getStatusTip()));
|
||||
if (macro->getPixmap())
|
||||
action->setIcon(Gui::BitmapFactory().pixmap(macro->getPixmap()));
|
||||
action->setShortcut(QString::fromAscii(macro->getAccel()));
|
||||
action->setShortcut(QString::fromLatin1(macro->getAccel()));
|
||||
|
||||
QString accel = action->shortcut().toString(QKeySequence::NativeText);
|
||||
if (!accel.isEmpty()) {
|
||||
@@ -456,7 +456,7 @@ void IconDialog::onAddIconPath()
|
||||
QStringList filters;
|
||||
QList<QByteArray> formats = QImageReader::supportedImageFormats();
|
||||
for (QList<QByteArray>::iterator jt = formats.begin(); jt != formats.end(); ++jt)
|
||||
filters << QString::fromAscii("*.%1").arg(QString::fromAscii(*jt).toLower());
|
||||
filters << QString::fromLatin1("*.%1").arg(QString::fromLatin1(*jt).toLower());
|
||||
QDir d(*it);
|
||||
d.setNameFilters(filters);
|
||||
QFileInfoList fi = d.entryInfoList();
|
||||
@@ -505,7 +505,7 @@ QString DlgCustomActionsImp::newActionName()
|
||||
do
|
||||
{
|
||||
bUsed = false;
|
||||
sName = QString::fromAscii("Std_Macro_%1").arg( id++ );
|
||||
sName = QString::fromLatin1("Std_Macro_%1").arg( id++ );
|
||||
|
||||
std::vector<Command*>::iterator it;
|
||||
for ( it = aclCurMacros.begin(); it!= aclCurMacros.end(); ++it )
|
||||
|
||||
@@ -42,9 +42,9 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgActivateWindowImp::DlgActivateWindowImp(QWidget* parent, Qt::WFlags fl)
|
||||
DlgActivateWindowImp::DlgActivateWindowImp(QWidget* parent, Qt::WindowFlags fl)
|
||||
: QDialog(parent, fl), ui(new Ui_DlgActivateWindow)
|
||||
{
|
||||
// create widgets
|
||||
|
||||
@@ -40,7 +40,7 @@ class DlgActivateWindowImp : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgActivateWindowImp(QWidget* parent = 0, Qt::WFlags fl = 0);
|
||||
DlgActivateWindowImp(QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
~DlgActivateWindowImp();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -58,7 +58,7 @@ struct GroupMap_find {
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgCustomCommandsImp::DlgCustomCommandsImp( QWidget* parent )
|
||||
: CustomizeActionPage(parent)
|
||||
@@ -146,7 +146,7 @@ void DlgCustomCommandsImp::onGroupActivated(QTreeWidgetItem* item)
|
||||
commandTreeWidget->clear();
|
||||
|
||||
CommandManager & cCmdMgr = Application::Instance->commandManager();
|
||||
std::vector<Command*> aCmds = cCmdMgr.getGroupCommands(group.toAscii());
|
||||
std::vector<Command*> aCmds = cCmdMgr.getGroupCommands(group.toLatin1());
|
||||
if (group == QLatin1String("Macros")) {
|
||||
for (std::vector<Command*>::iterator it = aCmds.begin(); it != aCmds.end(); ++it) {
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem(commandTreeWidget);
|
||||
|
||||
@@ -44,9 +44,9 @@ QList<QByteArray> DlgCustomizeImp::_pages;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgCustomizeImp::DlgCustomizeImp(QWidget* parent, Qt::WFlags fl)
|
||||
DlgCustomizeImp::DlgCustomizeImp(QWidget* parent, Qt::WindowFlags fl)
|
||||
: QDialog(parent, fl)
|
||||
{
|
||||
setModal(false);
|
||||
|
||||
@@ -51,7 +51,7 @@ class DlgCustomizeImp : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgCustomizeImp(QWidget* parent = 0, Qt::WFlags fl = 0);
|
||||
DlgCustomizeImp(QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
~DlgCustomizeImp();
|
||||
|
||||
static void addPage(const char* className);
|
||||
|
||||
@@ -116,7 +116,7 @@ void ButtonModel::insertButtonRows(int number)
|
||||
{
|
||||
QString groupName;
|
||||
groupName.setNum(index);
|
||||
Base::Reference<ParameterGrp> newGroup = spaceballButtonGroup()->GetGroup(groupName.toAscii());//builds the group.
|
||||
Base::Reference<ParameterGrp> newGroup = spaceballButtonGroup()->GetGroup(groupName.toLatin1());//builds the group.
|
||||
newGroup->SetASCII("Command", "");
|
||||
}
|
||||
endInsertRows();
|
||||
@@ -126,14 +126,14 @@ void ButtonModel::insertButtonRows(int number)
|
||||
void ButtonModel::setCommand(int row, QString command)
|
||||
{
|
||||
GroupVector groupVector = spaceballButtonGroup()->GetGroups();
|
||||
groupVector.at(row)->SetASCII("Command", command.toAscii());
|
||||
groupVector.at(row)->SetASCII("Command", command.toLatin1());
|
||||
}
|
||||
|
||||
void ButtonModel::goButtonPress(int number)
|
||||
{
|
||||
QString numberString;
|
||||
numberString.setNum(number);
|
||||
if (!spaceballButtonGroup()->HasGroup(numberString.toAscii()))
|
||||
if (!spaceballButtonGroup()->HasGroup(numberString.toLatin1()))
|
||||
insertButtonRows(number);
|
||||
}
|
||||
|
||||
@@ -314,19 +314,19 @@ QVariant CommandModel::data(const QModelIndex &index, int role) const
|
||||
if (role == Qt::UserRole)
|
||||
{
|
||||
if (node->nodeType == CommandNode::CommandType)
|
||||
return QVariant(QString::fromAscii(node->aCommand->getName()));
|
||||
return QVariant(QString::fromLatin1(node->aCommand->getName()));
|
||||
if (node->nodeType == CommandNode::GroupType)
|
||||
{
|
||||
if (node->children.size() < 1)
|
||||
return QVariant();
|
||||
CommandNode *childNode = node->children.at(0);
|
||||
return QVariant(QString::fromAscii(childNode->aCommand->getGroupName()));
|
||||
return QVariant(QString::fromLatin1(childNode->aCommand->getGroupName()));
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
if (role == Qt::ToolTipRole)
|
||||
if (node->nodeType == CommandNode::CommandType)
|
||||
return QVariant(QString::fromAscii(node->aCommand->getToolTipText()));
|
||||
return QVariant(QString::fromLatin1(node->aCommand->getToolTipText()));
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ CommandNode* CommandModel::nodeFromIndex(const QModelIndex &index) const
|
||||
|
||||
void CommandModel::goAddMacro(const QByteArray ¯oName)
|
||||
{
|
||||
QModelIndexList indexList(this->match(this->index(0,0), Qt::UserRole, QVariant(QString::fromAscii("Macros")),
|
||||
QModelIndexList indexList(this->match(this->index(0,0), Qt::UserRole, QVariant(QString::fromLatin1("Macros")),
|
||||
1, Qt::MatchWrap | Qt::MatchRecursive));
|
||||
QModelIndex macrosIndex;
|
||||
if (indexList.size() < 1)
|
||||
@@ -366,7 +366,7 @@ void CommandModel::goAddMacro(const QByteArray ¯oName)
|
||||
//this is the first macro and we have to add the Macros item.
|
||||
//figure out where to insert it. Should be in the command groups now.
|
||||
QStringList groups = orderedGroups();
|
||||
int location(groups.indexOf(QString::fromAscii("Macros")));
|
||||
int location(groups.indexOf(QString::fromLatin1("Macros")));
|
||||
if (location == -1)
|
||||
location = groups.size();
|
||||
//add row
|
||||
@@ -399,7 +399,7 @@ void CommandModel::goAddMacro(const QByteArray ¯oName)
|
||||
|
||||
void CommandModel::goRemoveMacro(const QByteArray ¯oName)
|
||||
{
|
||||
QModelIndexList macroList(this->match(this->index(0,0), Qt::UserRole, QVariant(QString::fromAscii(macroName.data())),
|
||||
QModelIndexList macroList(this->match(this->index(0,0), Qt::UserRole, QVariant(QString::fromLatin1(macroName.data())),
|
||||
1, Qt::MatchWrap | Qt::MatchRecursive));
|
||||
if (macroList.isEmpty())
|
||||
return;
|
||||
@@ -439,7 +439,7 @@ void CommandModel::groupCommands(const QString& groupName)
|
||||
CommandNode *parentNode = new CommandNode(CommandNode::GroupType);
|
||||
parentNode->parent = rootNode;
|
||||
rootNode->children.push_back(parentNode);
|
||||
std::vector <Command*> commands = Application::Instance->commandManager().getGroupCommands(groupName.toAscii());
|
||||
std::vector <Command*> commands = Application::Instance->commandManager().getGroupCommands(groupName.toLatin1());
|
||||
for (std::vector <Command*>::iterator it = commands.begin(); it != commands.end(); ++it)
|
||||
{
|
||||
CommandNode *childNode = new CommandNode(CommandNode::CommandType);
|
||||
@@ -455,7 +455,7 @@ QStringList CommandModel::orderedGroups()
|
||||
std::vector <Command*> commands = Application::Instance->commandManager().getAllCommands();
|
||||
for (std::vector <Command*>::iterator it = commands.begin(); it != commands.end(); ++it)
|
||||
{
|
||||
QString groupName(QString::fromAscii((*it)->getGroupName()));
|
||||
QString groupName(QString::fromLatin1((*it)->getGroupName()));
|
||||
if (!groups.contains(groupName))
|
||||
groups << groupName;
|
||||
}
|
||||
|
||||
@@ -62,9 +62,9 @@ using namespace std;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgDisplayPropertiesImp::DlgDisplayPropertiesImp( QWidget* parent, Qt::WFlags fl )
|
||||
DlgDisplayPropertiesImp::DlgDisplayPropertiesImp( QWidget* parent, Qt::WindowFlags fl )
|
||||
: QDialog( parent, fl )
|
||||
{
|
||||
this->setupUi(this);
|
||||
@@ -274,14 +274,14 @@ void DlgDisplayPropertiesImp::on_changeMode_activated(const QString& s)
|
||||
App::Property* prop = (*It)->getPropertyByName("DisplayMode");
|
||||
if (prop && prop->getTypeId() == App::PropertyEnumeration::getClassTypeId()) {
|
||||
App::PropertyEnumeration* Display = (App::PropertyEnumeration*)prop;
|
||||
Display->setValue((const char*)s.toAscii());
|
||||
Display->setValue((const char*)s.toLatin1());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DlgDisplayPropertiesImp::on_changePlot_activated(const QString&s)
|
||||
{
|
||||
Base::Console().Log("Plot = %s\n",(const char*)s.toAscii());
|
||||
Base::Console().Log("Plot = %s\n",(const char*)s.toLatin1());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -406,7 +406,7 @@ void DlgDisplayPropertiesImp::setDisplayModes(const std::vector<Gui::ViewProvide
|
||||
App::Property* prop = (*it)->getPropertyByName("DisplayMode");
|
||||
if (prop && prop->getTypeId() == App::PropertyEnumeration::getClassTypeId()) {
|
||||
App::PropertyEnumeration* display = static_cast<App::PropertyEnumeration*>(prop);
|
||||
QString activeMode = QString::fromAscii(display->getValueAsString());
|
||||
QString activeMode = QString::fromLatin1(display->getValueAsString());
|
||||
int index = changeMode->findText(activeMode);
|
||||
if (index != -1) {
|
||||
changeMode->setCurrentIndex(index);
|
||||
|
||||
@@ -55,7 +55,7 @@ class DlgDisplayPropertiesImp : public QDialog, public Ui_DlgDisplayProperties,
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgDisplayPropertiesImp( QWidget* parent = 0, Qt::WFlags fl = 0 );
|
||||
DlgDisplayPropertiesImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 );
|
||||
~DlgDisplayPropertiesImp();
|
||||
/// Observer message from the Selection
|
||||
void OnChange(Gui::SelectionSingleton::SubjectType &rCaller,
|
||||
|
||||
@@ -41,11 +41,11 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgEditFileIncludePropertyExternal::
|
||||
DlgEditFileIncludePropertyExternal(App::PropertyFileIncluded& Prop,
|
||||
QWidget* parent, Qt::WFlags fl)
|
||||
QWidget* parent, Qt::WindowFlags fl)
|
||||
: DlgRunExternal(parent, fl), Prop(Prop)
|
||||
{
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class GuiExport DlgEditFileIncludePropertyExternal : public DlgRunExternal
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgEditFileIncludePropertyExternal( App::PropertyFileIncluded& Prop, QWidget* parent = 0, Qt::WFlags fl = 0 );
|
||||
DlgEditFileIncludePropertyExternal( App::PropertyFileIncluded& Prop, QWidget* parent = 0, Qt::WindowFlags fl = 0 );
|
||||
virtual ~DlgEditFileIncludePropertyExternal();
|
||||
|
||||
int Do(void);
|
||||
|
||||
+23
-23
@@ -51,7 +51,7 @@ struct DlgSettingsEditorP
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgSettingsEditorImp::DlgSettingsEditorImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
@@ -62,70 +62,70 @@ DlgSettingsEditorImp::DlgSettingsEditorImp( QWidget* parent )
|
||||
col = Qt::black;
|
||||
unsigned long lText = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Text")), lText));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Text")), lText));
|
||||
col = Qt::cyan;
|
||||
unsigned long lBookmarks = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Bookmark")), lBookmarks));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Bookmark")), lBookmarks));
|
||||
col = Qt::red;
|
||||
unsigned long lBreakpnts = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Breakpoint")), lBreakpnts));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Breakpoint")), lBreakpnts));
|
||||
col = Qt::blue;
|
||||
unsigned long lKeywords = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Keyword")), lKeywords));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Keyword")), lKeywords));
|
||||
col.setRgb(0, 170, 0);
|
||||
unsigned long lComments = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Comment")), lComments));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Comment")), lComments));
|
||||
col.setRgb(160, 160, 164);
|
||||
unsigned long lBlockCom = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Block comment")), lBlockCom));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Block comment")), lBlockCom));
|
||||
col = Qt::blue;
|
||||
unsigned long lNumbers = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Number")), lNumbers));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Number")), lNumbers));
|
||||
col = Qt::red;
|
||||
unsigned long lStrings = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("String")), lStrings));
|
||||
(QString::fromLatin1(QT_TR_NOOP("String")), lStrings));
|
||||
col = Qt::red;
|
||||
unsigned long lCharacter = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Character")), lCharacter));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Character")), lCharacter));
|
||||
col.setRgb(255, 170, 0);
|
||||
unsigned long lClass = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Class name")), lClass));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Class name")), lClass));
|
||||
col.setRgb(255, 170, 0);
|
||||
unsigned long lDefine = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Define name")), lDefine));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Define name")), lDefine));
|
||||
col.setRgb(160, 160, 164);
|
||||
unsigned long lOperat = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Operator")), lOperat));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Operator")), lOperat));
|
||||
col.setRgb(170, 170, 127);
|
||||
unsigned long lPyOutput = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Python output")), lPyOutput));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Python output")), lPyOutput));
|
||||
col = Qt::red;
|
||||
unsigned long lPyError = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Python error")), lPyError));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Python error")), lPyError));
|
||||
col.setRgb(224, 224, 224);
|
||||
unsigned long lCLine = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8);
|
||||
d->colormap.push_back(QPair<QString, unsigned long>
|
||||
(QString::fromAscii(QT_TR_NOOP("Current line highlight")), lCLine));
|
||||
(QString::fromLatin1(QT_TR_NOOP("Current line highlight")), lCLine));
|
||||
|
||||
QStringList labels; labels << tr("Items");
|
||||
this->displayItems->setHeaderLabels(labels);
|
||||
this->displayItems->header()->hide();
|
||||
for (QVector<QPair<QString, unsigned long> >::ConstIterator it = d->colormap.begin(); it != d->colormap.end(); ++it) {
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem(this->displayItems);
|
||||
item->setText(0, tr((*it).first.toAscii()));
|
||||
item->setText(0, tr((*it).first.toLatin1()));
|
||||
}
|
||||
pythonSyntax = new PythonSyntaxHighlighter(textEdit1);
|
||||
pythonSyntax->setDocument(textEdit1->document());
|
||||
@@ -173,10 +173,10 @@ void DlgSettingsEditorImp::saveSettings()
|
||||
// Saves the color map
|
||||
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Editor");
|
||||
for (QVector<QPair<QString, unsigned long> >::ConstIterator it = d->colormap.begin(); it != d->colormap.end(); ++it)
|
||||
hGrp->SetUnsigned((*it).first.toAscii(), (*it).second);
|
||||
hGrp->SetUnsigned((*it).first.toLatin1(), (*it).second);
|
||||
|
||||
hGrp->SetInt( "FontSize", fontSize->value() );
|
||||
hGrp->SetASCII( "Font", fontFamily->currentText().toAscii() );
|
||||
hGrp->SetASCII( "Font", fontFamily->currentText().toLatin1() );
|
||||
}
|
||||
|
||||
void DlgSettingsEditorImp::loadSettings()
|
||||
@@ -188,7 +188,7 @@ void DlgSettingsEditorImp::loadSettings()
|
||||
radioTabs->onRestore();
|
||||
radioSpaces->onRestore();
|
||||
|
||||
textEdit1->setPlainText(QString::fromAscii(
|
||||
textEdit1->setPlainText(QString::fromLatin1(
|
||||
"# Short Python sample\n"
|
||||
"import sys\n"
|
||||
"def foo(begin, end):\n"
|
||||
@@ -203,7 +203,7 @@ void DlgSettingsEditorImp::loadSettings()
|
||||
// Restores the color map
|
||||
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Editor");
|
||||
for (QVector<QPair<QString, unsigned long> >::Iterator it = d->colormap.begin(); it != d->colormap.end(); ++it){
|
||||
unsigned long col = hGrp->GetUnsigned((*it).first.toAscii(), (*it).second);
|
||||
unsigned long col = hGrp->GetUnsigned((*it).first.toLatin1(), (*it).second);
|
||||
(*it).second = col;
|
||||
QColor color;
|
||||
color.setRgb((col >> 24) & 0xff, (col >> 16) & 0xff, (col >> 8) & 0xff);
|
||||
@@ -218,7 +218,7 @@ void DlgSettingsEditorImp::loadSettings()
|
||||
QFontDatabase fdb;
|
||||
QStringList familyNames = fdb.families( QFontDatabase::Any );
|
||||
fontFamily->addItems(familyNames);
|
||||
int index = familyNames.indexOf(QString::fromAscii(hGrp->GetASCII("Font", "Courier").c_str()));
|
||||
int index = familyNames.indexOf(QString::fromLatin1(hGrp->GetASCII("Font", "Courier").c_str()));
|
||||
if (index < 0) index = 0;
|
||||
fontFamily->setCurrentIndex(index);
|
||||
on_fontFamily_activated();
|
||||
@@ -234,7 +234,7 @@ void DlgSettingsEditorImp::changeEvent(QEvent *e)
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
int index = 0;
|
||||
for (QVector<QPair<QString, unsigned long> >::ConstIterator it = d->colormap.begin(); it != d->colormap.end(); ++it)
|
||||
this->displayItems->topLevelItem(index++)->setText(0, tr((*it).first.toAscii()));
|
||||
this->displayItems->topLevelItem(index++)->setText(0, tr((*it).first.toLatin1()));
|
||||
this->retranslateUi(this);
|
||||
} else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
+11
-11
@@ -46,7 +46,7 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgGeneralImp::DlgGeneralImp( QWidget* parent )
|
||||
: PreferencePage( parent ), watched(0)
|
||||
@@ -121,7 +121,7 @@ void DlgGeneralImp::saveSettings()
|
||||
QVariant data = AutoloadModuleCombo->itemData(index);
|
||||
QString startWbName = data.toString();
|
||||
App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")->
|
||||
SetASCII("AutoloadModule", startWbName.toAscii());
|
||||
SetASCII("AutoloadModule", startWbName.toLatin1());
|
||||
|
||||
AutoloadTabCombo->onSave();
|
||||
RecentFiles->onSave();
|
||||
@@ -133,7 +133,7 @@ void DlgGeneralImp::saveSettings()
|
||||
setRecentFileSize();
|
||||
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("General");
|
||||
QString lang = QLocale::languageToString(QLocale::system().language());
|
||||
QByteArray language = hGrp->GetASCII("Language", (const char*)lang.toAscii()).c_str();
|
||||
QByteArray language = hGrp->GetASCII("Language", (const char*)lang.toLatin1()).c_str();
|
||||
QByteArray current = Languages->itemData(Languages->currentIndex()).toByteArray();
|
||||
if (current != language)
|
||||
{
|
||||
@@ -216,14 +216,14 @@ void DlgGeneralImp::loadSettings()
|
||||
// search for the language files
|
||||
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("General");
|
||||
QString lang = QLocale::languageToString(QLocale::system().language());
|
||||
QByteArray language = hGrp->GetASCII("Language", (const char*)lang.toAscii()).c_str();
|
||||
QByteArray language = hGrp->GetASCII("Language", (const char*)lang.toLatin1()).c_str();
|
||||
int index = 1;
|
||||
Languages->addItem(QString::fromAscii("English"), QByteArray("English"));
|
||||
Languages->addItem(QString::fromLatin1("English"), QByteArray("English"));
|
||||
TStringMap list = Translator::instance()->supportedLocales();
|
||||
for (TStringMap::iterator it = list.begin(); it != list.end(); ++it, index++) {
|
||||
QLocale locale(QString::fromAscii(it->second.c_str()));
|
||||
QLocale locale(QString::fromLatin1(it->second.c_str()));
|
||||
QByteArray lang = it->first.c_str();
|
||||
QString langname = QString::fromAscii(lang.constData());
|
||||
QString langname = QString::fromLatin1(lang.constData());
|
||||
#if QT_VERSION >= 0x040800
|
||||
QString native = locale.nativeLanguageName();
|
||||
if (!native.isEmpty()) {
|
||||
@@ -254,8 +254,8 @@ void DlgGeneralImp::loadSettings()
|
||||
QMap<QString, QString> cssFiles;
|
||||
QDir dir;
|
||||
QStringList filter;
|
||||
filter << QString::fromAscii("*.qss");
|
||||
filter << QString::fromAscii("*.css");
|
||||
filter << QString::fromLatin1("*.qss");
|
||||
filter << QString::fromLatin1("*.css");
|
||||
QFileInfoList fileNames;
|
||||
|
||||
// read from user, resource and built-in directory
|
||||
@@ -271,12 +271,12 @@ void DlgGeneralImp::loadSettings()
|
||||
}
|
||||
|
||||
// now add all unique items
|
||||
this->StyleSheets->addItem(tr("No style sheet"), QString::fromAscii(""));
|
||||
this->StyleSheets->addItem(tr("No style sheet"), QString::fromLatin1(""));
|
||||
for (QMap<QString, QString>::iterator it = cssFiles.begin(); it != cssFiles.end(); ++it) {
|
||||
this->StyleSheets->addItem(it.key(), it.value());
|
||||
}
|
||||
|
||||
this->selectedStyleSheet = QString::fromAscii(hGrp->GetASCII("StyleSheet").c_str());
|
||||
this->selectedStyleSheet = QString::fromLatin1(hGrp->GetASCII("StyleSheet").c_str());
|
||||
index = this->StyleSheets->findData(this->selectedStyleSheet);
|
||||
if (index > -1) this->StyleSheets->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgInputDialogImp::DlgInputDialogImp( const QString& labelTxt, QWidget* parent, bool modal, Type type )
|
||||
: QDialog( parent )
|
||||
@@ -66,7 +66,7 @@ DlgInputDialogImp::~DlgInputDialogImp()
|
||||
|
||||
void DlgInputDialogImp::textChanged( const QString &s )
|
||||
{
|
||||
bool on = TRUE;
|
||||
bool on = true;
|
||||
|
||||
if (lineEdit->validator()) {
|
||||
QString str = lineEdit->text();
|
||||
|
||||
@@ -43,7 +43,7 @@ class GuiExport DlgInputDialogImp : public QDialog, public Ui_DlgInputDialog
|
||||
public:
|
||||
enum Type { LineEdit, SpinBox, UIntBox, FloatSpinBox, ComboBox };
|
||||
|
||||
DlgInputDialogImp( const QString& label, QWidget* parent = 0, bool modal = TRUE, Type = LineEdit );
|
||||
DlgInputDialogImp( const QString& label, QWidget* parent = 0, bool modal = true, Type = LineEdit );
|
||||
~DlgInputDialogImp();
|
||||
|
||||
void setType( Type t );
|
||||
|
||||
+12
-11
@@ -61,7 +61,7 @@ struct GroupMap_find {
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgCustomKeyboardImp::DlgCustomKeyboardImp( QWidget* parent )
|
||||
: CustomizeActionPage(parent), firstShow(true)
|
||||
@@ -141,22 +141,22 @@ void DlgCustomKeyboardImp::on_commandTreeWidget_currentItemChanged(QTreeWidgetIt
|
||||
if (cmd) {
|
||||
if (cmd->getAction()) {
|
||||
QKeySequence ks = cmd->getAction()->shortcut();
|
||||
QKeySequence ks2 = QString::fromAscii(cmd->getAccel());
|
||||
QKeySequence ks2 = QString::fromLatin1(cmd->getAccel());
|
||||
QKeySequence ks3 = editShortcut->text();
|
||||
|
||||
if (ks.isEmpty())
|
||||
accelLineEditShortcut->setText( tr("none") );
|
||||
else
|
||||
accelLineEditShortcut->setText(ks);
|
||||
accelLineEditShortcut->setText(ks.toString(QKeySequence::NativeText));
|
||||
|
||||
buttonAssign->setEnabled(!editShortcut->text().isEmpty() && (ks != ks3));
|
||||
buttonReset->setEnabled((ks != ks2));
|
||||
} else {
|
||||
QKeySequence ks = QString::fromAscii(cmd->getAccel());
|
||||
QKeySequence ks = QString::fromLatin1(cmd->getAccel());
|
||||
if (ks.isEmpty())
|
||||
accelLineEditShortcut->setText( tr("none") );
|
||||
else
|
||||
accelLineEditShortcut->setText(ks);
|
||||
accelLineEditShortcut->setText(ks.toString(QKeySequence::NativeText));
|
||||
buttonAssign->setEnabled(false);
|
||||
buttonReset->setEnabled(false);
|
||||
}
|
||||
@@ -177,7 +177,7 @@ void DlgCustomKeyboardImp::on_categoryBox_activated(int index)
|
||||
editShortcut->clear();
|
||||
|
||||
CommandManager & cCmdMgr = Application::Instance->commandManager();
|
||||
std::vector<Command*> aCmds = cCmdMgr.getGroupCommands( group.toAscii() );
|
||||
std::vector<Command*> aCmds = cCmdMgr.getGroupCommands( group.toLatin1() );
|
||||
|
||||
if (group == QLatin1String("Macros")) {
|
||||
for (std::vector<Command*>::iterator it = aCmds.begin(); it != aCmds.end(); ++it) {
|
||||
@@ -218,7 +218,7 @@ void DlgCustomKeyboardImp::on_buttonAssign_clicked()
|
||||
if (cmd && cmd->getAction()) {
|
||||
Action* action = cmd->getAction();
|
||||
QKeySequence shortcut = editShortcut->text();
|
||||
action->setShortcut(shortcut);
|
||||
action->setShortcut(shortcut.toString(QKeySequence::NativeText));
|
||||
accelLineEditShortcut->setText(editShortcut->text());
|
||||
editShortcut->clear();
|
||||
|
||||
@@ -273,8 +273,8 @@ void DlgCustomKeyboardImp::on_buttonReset_clicked()
|
||||
CommandManager & cCmdMgr = Application::Instance->commandManager();
|
||||
Command* cmd = cCmdMgr.getCommandByName(name.constData());
|
||||
if (cmd && cmd->getAction()) {
|
||||
cmd->getAction()->setShortcut(QString::fromAscii(cmd->getAccel()));
|
||||
QString txt = cmd->getAction()->shortcut();
|
||||
cmd->getAction()->setShortcut(QString::fromLatin1(cmd->getAccel()));
|
||||
QString txt = cmd->getAction()->shortcut().toString(QKeySequence::NativeText);
|
||||
accelLineEditShortcut->setText((txt.isEmpty() ? tr("none") : txt));
|
||||
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Shortcut");
|
||||
hGrp->RemoveASCII(name.constData());
|
||||
@@ -290,7 +290,8 @@ void DlgCustomKeyboardImp::on_buttonResetAll_clicked()
|
||||
std::vector<Command*> cmds = cCmdMgr.getAllCommands();
|
||||
for (std::vector<Command*>::iterator it = cmds.begin(); it != cmds.end(); ++it) {
|
||||
if ((*it)->getAction()) {
|
||||
(*it)->getAction()->setShortcut(QKeySequence(QString::fromAscii((*it)->getAccel())));
|
||||
(*it)->getAction()->setShortcut(QKeySequence(QString::fromLatin1((*it)->getAccel()))
|
||||
.toString(QKeySequence::NativeText));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,7 +333,7 @@ void DlgCustomKeyboardImp::on_editShortcut_textChanged(const QString& sc)
|
||||
for (QList<QAction*>::iterator jt = acts.begin(); jt != acts.end(); ++jt) {
|
||||
if ((*jt)->shortcut() == ks) {
|
||||
++countAmbiguous;
|
||||
ambiguousCommand = QString::fromAscii((*it)->getName()); // store the last one
|
||||
ambiguousCommand = QString::fromLatin1((*it)->getName()); // store the last one
|
||||
ambiguousMenu = qApp->translate((*it)->className(), (*it)->getMenuText());
|
||||
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem(assignedTreeWidget);
|
||||
|
||||
@@ -52,9 +52,9 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgMacroExecuteImp::DlgMacroExecuteImp( QWidget* parent, Qt::WFlags fl )
|
||||
DlgMacroExecuteImp::DlgMacroExecuteImp( QWidget* parent, Qt::WindowFlags fl )
|
||||
: QDialog( parent, fl ), WindowParameter( "Macro" )
|
||||
{
|
||||
this->setupUi(this);
|
||||
@@ -157,7 +157,7 @@ void DlgMacroExecuteImp::on_editButton_clicked()
|
||||
if (!item) return;
|
||||
|
||||
QDir dir(this->macroPath);
|
||||
QString file = QString::fromAscii("%1/%2").arg(dir.absolutePath()).arg(item->text(0));
|
||||
QString file = QString::fromLatin1("%1/%2").arg(dir.absolutePath()).arg(item->text(0));
|
||||
|
||||
Application::Instance->open(file.toUtf8(), "FreeCADGui");
|
||||
close();
|
||||
@@ -194,7 +194,7 @@ void DlgMacroExecuteImp::on_createButton_clicked()
|
||||
editor->setWindowIcon(Gui::BitmapFactory().iconFromTheme("applications-python"));
|
||||
PythonEditorView* edit = new PythonEditorView(editor, getMainWindow());
|
||||
edit->open(fi.absoluteFilePath());
|
||||
edit->setWindowTitle(QString::fromAscii("%1[*]").arg(fn));
|
||||
edit->setWindowTitle(QString::fromLatin1("%1[*]").arg(fn));
|
||||
edit->resize(400, 300);
|
||||
getMainWindow()->addWindow(edit);
|
||||
close();
|
||||
|
||||
@@ -40,7 +40,7 @@ class DlgMacroExecuteImp : public QDialog, public Ui_DlgMacroExecute, public Gui
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgMacroExecuteImp( QWidget* parent = 0, Qt::WFlags fl = 0 );
|
||||
DlgMacroExecuteImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 );
|
||||
~DlgMacroExecuteImp();
|
||||
|
||||
void accept();
|
||||
|
||||
@@ -45,9 +45,9 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgMacroRecordImp::DlgMacroRecordImp( QWidget* parent, Qt::WFlags fl )
|
||||
DlgMacroRecordImp::DlgMacroRecordImp( QWidget* parent, Qt::WindowFlags fl )
|
||||
: QDialog(parent, fl), WindowParameter("Macro")
|
||||
{
|
||||
this->setupUi(this);
|
||||
|
||||
@@ -41,7 +41,7 @@ class DlgMacroRecordImp : public QDialog, public Ui_DlgMacroRecord, public Gui::
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgMacroRecordImp( QWidget* parent = 0, Qt::WFlags fl = 0 );
|
||||
DlgMacroRecordImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 );
|
||||
virtual ~DlgMacroRecordImp();
|
||||
|
||||
protected Q_SLOTS:
|
||||
|
||||
@@ -41,9 +41,9 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgMaterialPropertiesImp::DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent, Qt::WFlags fl)
|
||||
DlgMaterialPropertiesImp::DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent, Qt::WindowFlags fl)
|
||||
: QDialog(parent, fl), material(mat)
|
||||
{
|
||||
this->setupUi(this);
|
||||
|
||||
@@ -37,7 +37,7 @@ class DlgMaterialPropertiesImp : public QDialog, public Ui_DlgMaterialProperties
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent = 0, Qt::WFlags fl = 0);
|
||||
DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
~DlgMaterialPropertiesImp();
|
||||
void setViewProviders(const std::vector<Gui::ViewProvider*>&);
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgOnlineHelpImp::DlgOnlineHelpImp( QWidget* parent )
|
||||
: PreferencePage(parent)
|
||||
|
||||
+56
-56
@@ -54,9 +54,9 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WFlags fl )
|
||||
DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WindowFlags fl )
|
||||
: QDialog( parent, fl|Qt::WindowMinMaxButtonsHint )
|
||||
{
|
||||
this->setupUi(this);
|
||||
@@ -313,7 +313,7 @@ bool validateInput(QWidget* parent, const QString& input)
|
||||
if (input.isEmpty())
|
||||
return false;
|
||||
for (int i=0; i<input.size(); i++) {
|
||||
const char c = input.at(i).toAscii();
|
||||
const char c = input.at(i).toLatin1();
|
||||
if ((c < '0' || c > '9') && // Numbers
|
||||
(c < 'A' || c > 'Z') && // Uppercase letters
|
||||
(c < 'a' || c > 'z') && // Lowercase letters
|
||||
@@ -393,7 +393,7 @@ void ParameterGroup::onDeleteSelectedItem()
|
||||
int index = parent->indexOfChild(sel);
|
||||
parent->takeChild(index);
|
||||
ParameterGroupItem* para = static_cast<ParameterGroupItem*>(parent);
|
||||
para->_hcGrp->RemoveGrp(sel->text(0).toAscii());
|
||||
para->_hcGrp->RemoveGrp(sel->text(0).toLatin1());
|
||||
delete sel;
|
||||
}
|
||||
}
|
||||
@@ -425,14 +425,14 @@ void ParameterGroup::onCreateSubgroup()
|
||||
ParameterGroupItem* para = static_cast<ParameterGroupItem*>(item);
|
||||
Base::Reference<ParameterGrp> hGrp = para->_hcGrp;
|
||||
|
||||
if ( hGrp->HasGroup( name.toAscii() ) )
|
||||
if ( hGrp->HasGroup( name.toLatin1() ) )
|
||||
{
|
||||
QMessageBox::critical( this, tr("Existing sub-group"),
|
||||
tr("The sub-group '%1' already exists.").arg( name ) );
|
||||
return;
|
||||
}
|
||||
|
||||
hGrp = hGrp->GetGroup( name.toAscii() );
|
||||
hGrp = hGrp->GetGroup( name.toLatin1() );
|
||||
(void)new ParameterGroupItem(para,hGrp);
|
||||
expandItem(para);
|
||||
}
|
||||
@@ -757,8 +757,8 @@ void ParameterValue::onCreateBoolItem()
|
||||
}
|
||||
}
|
||||
|
||||
QStringList list; list << QString::fromAscii("true")
|
||||
<< QString::fromAscii("false");
|
||||
QStringList list; list << QString::fromLatin1("true")
|
||||
<< QString::fromLatin1("false");
|
||||
QString val = QInputDialog::getItem (this, QObject::tr("New boolean item"), QObject::tr("Choose an item:"),
|
||||
list, 0, false, &ok);
|
||||
if ( ok )
|
||||
@@ -822,7 +822,7 @@ void ParameterGroupItem::setData ( int column, int role, const QVariant & value
|
||||
QObject::tr("The group '%1' cannot be renamed.").arg( oldName ) );
|
||||
return;
|
||||
}
|
||||
if ( item->_hcGrp->HasGroup( newName.toAscii() ) )
|
||||
if ( item->_hcGrp->HasGroup( newName.toLatin1() ) )
|
||||
{
|
||||
QMessageBox::critical( treeWidget(), QObject::tr("Existing group"),
|
||||
QObject::tr("The group '%1' already exists.").arg( newName ) );
|
||||
@@ -831,10 +831,10 @@ void ParameterGroupItem::setData ( int column, int role, const QVariant & value
|
||||
else
|
||||
{
|
||||
// rename the group by adding a new group, copy the content and remove the old group
|
||||
Base::Reference<ParameterGrp> hOldGrp = item->_hcGrp->GetGroup( oldName.toAscii() );
|
||||
Base::Reference<ParameterGrp> hNewGrp = item->_hcGrp->GetGroup( newName.toAscii() );
|
||||
Base::Reference<ParameterGrp> hOldGrp = item->_hcGrp->GetGroup( oldName.toLatin1() );
|
||||
Base::Reference<ParameterGrp> hNewGrp = item->_hcGrp->GetGroup( newName.toLatin1() );
|
||||
hOldGrp->copyTo( hNewGrp );
|
||||
item->_hcGrp->RemoveGrp( oldName.toAscii() );
|
||||
item->_hcGrp->RemoveGrp( oldName.toLatin1() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -891,7 +891,7 @@ ParameterText::ParameterText ( QTreeWidget * parent, QString label, const char*
|
||||
{
|
||||
setIcon(0,BitmapFactory().pixmap("Param_Text") );
|
||||
setText(0, label);
|
||||
setText(1, QString::fromAscii("Text"));
|
||||
setText(1, QString::fromLatin1("Text"));
|
||||
setText(2, QString::fromUtf8(value));
|
||||
}
|
||||
|
||||
@@ -907,25 +907,25 @@ void ParameterText::changeValue()
|
||||
if ( ok )
|
||||
{
|
||||
setText( 2, txt );
|
||||
_hcGrp->SetASCII(text(0).toAscii(), txt.toUtf8());
|
||||
_hcGrp->SetASCII(text(0).toLatin1(), txt.toUtf8());
|
||||
}
|
||||
}
|
||||
|
||||
void ParameterText::removeFromGroup ()
|
||||
{
|
||||
_hcGrp->RemoveASCII(text(0).toAscii());
|
||||
_hcGrp->RemoveASCII(text(0).toLatin1());
|
||||
}
|
||||
|
||||
void ParameterText::replace( const QString& oldName, const QString& newName )
|
||||
{
|
||||
std::string val = _hcGrp->GetASCII(oldName.toAscii());
|
||||
_hcGrp->RemoveASCII(oldName.toAscii());
|
||||
_hcGrp->SetASCII(newName.toAscii(), val.c_str());
|
||||
std::string val = _hcGrp->GetASCII(oldName.toLatin1());
|
||||
_hcGrp->RemoveASCII(oldName.toLatin1());
|
||||
_hcGrp->SetASCII(newName.toLatin1(), val.c_str());
|
||||
}
|
||||
|
||||
void ParameterText::appendToGroup()
|
||||
{
|
||||
_hcGrp->SetASCII(text(0).toAscii(), text(2).toUtf8());
|
||||
_hcGrp->SetASCII(text(0).toLatin1(), text(2).toUtf8());
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -935,8 +935,8 @@ ParameterInt::ParameterInt ( QTreeWidget * parent, QString label, long value, co
|
||||
{
|
||||
setIcon(0,BitmapFactory().pixmap("Param_Int") );
|
||||
setText(0, label);
|
||||
setText(1, QString::fromAscii("Integer"));
|
||||
setText(2, QString::fromAscii("%1").arg(value));
|
||||
setText(1, QString::fromLatin1("Integer"));
|
||||
setText(2, QString::fromLatin1("%1").arg(value));
|
||||
}
|
||||
|
||||
ParameterInt::~ParameterInt()
|
||||
@@ -950,26 +950,26 @@ void ParameterInt::changeValue()
|
||||
text(2).toInt(), -2147483647, 2147483647, 1, &ok);
|
||||
if ( ok )
|
||||
{
|
||||
setText(2, QString::fromAscii("%1").arg(num));
|
||||
_hcGrp->SetInt(text(0).toAscii(), (long)num);
|
||||
setText(2, QString::fromLatin1("%1").arg(num));
|
||||
_hcGrp->SetInt(text(0).toLatin1(), (long)num);
|
||||
}
|
||||
}
|
||||
|
||||
void ParameterInt::removeFromGroup ()
|
||||
{
|
||||
_hcGrp->RemoveInt(text(0).toAscii());
|
||||
_hcGrp->RemoveInt(text(0).toLatin1());
|
||||
}
|
||||
|
||||
void ParameterInt::replace( const QString& oldName, const QString& newName )
|
||||
{
|
||||
long val = _hcGrp->GetInt(oldName.toAscii());
|
||||
_hcGrp->RemoveInt(oldName.toAscii());
|
||||
_hcGrp->SetInt(newName.toAscii(), val);
|
||||
long val = _hcGrp->GetInt(oldName.toLatin1());
|
||||
_hcGrp->RemoveInt(oldName.toLatin1());
|
||||
_hcGrp->SetInt(newName.toLatin1(), val);
|
||||
}
|
||||
|
||||
void ParameterInt::appendToGroup()
|
||||
{
|
||||
_hcGrp->SetInt(text(0).toAscii(), text(2).toLong());
|
||||
_hcGrp->SetInt(text(0).toLatin1(), text(2).toLong());
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -979,8 +979,8 @@ ParameterUInt::ParameterUInt ( QTreeWidget * parent, QString label, unsigned lon
|
||||
{
|
||||
setIcon(0,BitmapFactory().pixmap("Param_UInt") );
|
||||
setText(0, label);
|
||||
setText(1, QString::fromAscii("Unsigned"));
|
||||
setText(2, QString::fromAscii("%1").arg(value));
|
||||
setText(1, QString::fromLatin1("Unsigned"));
|
||||
setText(2, QString::fromLatin1("%1").arg(value));
|
||||
}
|
||||
|
||||
ParameterUInt::~ParameterUInt()
|
||||
@@ -1002,27 +1002,27 @@ void ParameterUInt::changeValue()
|
||||
|
||||
if ( ok )
|
||||
{
|
||||
setText(2, QString::fromAscii("%1").arg(num));
|
||||
_hcGrp->SetUnsigned(text(0).toAscii(), (unsigned long)num);
|
||||
setText(2, QString::fromLatin1("%1").arg(num));
|
||||
_hcGrp->SetUnsigned(text(0).toLatin1(), (unsigned long)num);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ParameterUInt::removeFromGroup ()
|
||||
{
|
||||
_hcGrp->RemoveUnsigned(text(0).toAscii());
|
||||
_hcGrp->RemoveUnsigned(text(0).toLatin1());
|
||||
}
|
||||
|
||||
void ParameterUInt::replace( const QString& oldName, const QString& newName )
|
||||
{
|
||||
unsigned long val = _hcGrp->GetUnsigned(oldName.toAscii());
|
||||
_hcGrp->RemoveUnsigned(oldName.toAscii());
|
||||
_hcGrp->SetUnsigned(newName.toAscii(), val);
|
||||
unsigned long val = _hcGrp->GetUnsigned(oldName.toLatin1());
|
||||
_hcGrp->RemoveUnsigned(oldName.toLatin1());
|
||||
_hcGrp->SetUnsigned(newName.toLatin1(), val);
|
||||
}
|
||||
|
||||
void ParameterUInt::appendToGroup()
|
||||
{
|
||||
_hcGrp->SetUnsigned(text(0).toAscii(), text(2).toULong());
|
||||
_hcGrp->SetUnsigned(text(0).toLatin1(), text(2).toULong());
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -1032,8 +1032,8 @@ ParameterFloat::ParameterFloat ( QTreeWidget * parent, QString label, double val
|
||||
{
|
||||
setIcon(0,BitmapFactory().pixmap("Param_Float") );
|
||||
setText(0, label);
|
||||
setText(1, QString::fromAscii("Float"));
|
||||
setText(2, QString::fromAscii("%1").arg(value));
|
||||
setText(1, QString::fromLatin1("Float"));
|
||||
setText(2, QString::fromLatin1("%1").arg(value));
|
||||
}
|
||||
|
||||
ParameterFloat::~ParameterFloat()
|
||||
@@ -1047,26 +1047,26 @@ void ParameterFloat::changeValue()
|
||||
text(2).toDouble(), -2147483647, 2147483647, 12, &ok);
|
||||
if ( ok )
|
||||
{
|
||||
setText(2, QString::fromAscii("%1").arg(num));
|
||||
_hcGrp->SetFloat(text(0).toAscii(), num);
|
||||
setText(2, QString::fromLatin1("%1").arg(num));
|
||||
_hcGrp->SetFloat(text(0).toLatin1(), num);
|
||||
}
|
||||
}
|
||||
|
||||
void ParameterFloat::removeFromGroup ()
|
||||
{
|
||||
_hcGrp->RemoveFloat(text(0).toAscii());
|
||||
_hcGrp->RemoveFloat(text(0).toLatin1());
|
||||
}
|
||||
|
||||
void ParameterFloat::replace( const QString& oldName, const QString& newName )
|
||||
{
|
||||
double val = _hcGrp->GetFloat(oldName.toAscii());
|
||||
_hcGrp->RemoveFloat(oldName.toAscii());
|
||||
_hcGrp->SetFloat(newName.toAscii(), val);
|
||||
double val = _hcGrp->GetFloat(oldName.toLatin1());
|
||||
_hcGrp->RemoveFloat(oldName.toLatin1());
|
||||
_hcGrp->SetFloat(newName.toLatin1(), val);
|
||||
}
|
||||
|
||||
void ParameterFloat::appendToGroup()
|
||||
{
|
||||
_hcGrp->SetFloat(text(0).toAscii(), text(2).toDouble());
|
||||
_hcGrp->SetFloat(text(0).toLatin1(), text(2).toDouble());
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -1076,8 +1076,8 @@ ParameterBool::ParameterBool ( QTreeWidget * parent, QString label, bool value,
|
||||
{
|
||||
setIcon(0,BitmapFactory().pixmap("Param_Bool") );
|
||||
setText(0, label);
|
||||
setText(1, QString::fromAscii("Boolean"));
|
||||
setText(2, QString::fromAscii((value ? "true" : "false")));
|
||||
setText(1, QString::fromLatin1("Boolean"));
|
||||
setText(2, QString::fromLatin1((value ? "true" : "false")));
|
||||
}
|
||||
|
||||
ParameterBool::~ParameterBool()
|
||||
@@ -1087,8 +1087,8 @@ ParameterBool::~ParameterBool()
|
||||
void ParameterBool::changeValue()
|
||||
{
|
||||
bool ok;
|
||||
QStringList list; list << QString::fromAscii("true")
|
||||
<< QString::fromAscii("false");
|
||||
QStringList list; list << QString::fromLatin1("true")
|
||||
<< QString::fromLatin1("false");
|
||||
int pos = (text(2) == list[0] ? 0 : 1);
|
||||
|
||||
QString txt = QInputDialog::getItem (treeWidget(), QObject::tr("Change value"), QObject::tr("Choose an item:"),
|
||||
@@ -1096,26 +1096,26 @@ void ParameterBool::changeValue()
|
||||
if ( ok )
|
||||
{
|
||||
setText( 2, txt );
|
||||
_hcGrp->SetBool(text(0).toAscii(), (txt == list[0] ? true : false) );
|
||||
_hcGrp->SetBool(text(0).toLatin1(), (txt == list[0] ? true : false) );
|
||||
}
|
||||
}
|
||||
|
||||
void ParameterBool::removeFromGroup ()
|
||||
{
|
||||
_hcGrp->RemoveBool(text(0).toAscii());
|
||||
_hcGrp->RemoveBool(text(0).toLatin1());
|
||||
}
|
||||
|
||||
void ParameterBool::replace( const QString& oldName, const QString& newName )
|
||||
{
|
||||
bool val = _hcGrp->GetBool(oldName.toAscii());
|
||||
_hcGrp->RemoveBool(oldName.toAscii());
|
||||
_hcGrp->SetBool(newName.toAscii(), val);
|
||||
bool val = _hcGrp->GetBool(oldName.toLatin1());
|
||||
_hcGrp->RemoveBool(oldName.toLatin1());
|
||||
_hcGrp->SetBool(newName.toLatin1(), val);
|
||||
}
|
||||
|
||||
void ParameterBool::appendToGroup()
|
||||
{
|
||||
bool val = (text(2) == QLatin1String("true") ? true : false);
|
||||
_hcGrp->SetBool(text(0).toAscii(), val);
|
||||
_hcGrp->SetBool(text(0).toLatin1(), val);
|
||||
}
|
||||
|
||||
#include "moc_DlgParameterImp.cpp"
|
||||
|
||||
@@ -42,7 +42,7 @@ class DlgParameterImp : public QDialog, public Ui_DlgParameter
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgParameterImp( QWidget* parent = 0, Qt::WFlags fl = 0 );
|
||||
DlgParameterImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 );
|
||||
~DlgParameterImp();
|
||||
|
||||
void accept();
|
||||
|
||||
@@ -56,9 +56,9 @@ std::list<DlgPreferencesImp::TGroupPages> DlgPreferencesImp::_pages;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgPreferencesImp::DlgPreferencesImp( QWidget* parent, Qt::WFlags fl )
|
||||
DlgPreferencesImp::DlgPreferencesImp( QWidget* parent, Qt::WindowFlags fl )
|
||||
: QDialog(parent, fl), ui(new Ui_DlgPreferences), canEmbedScrollArea(true)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -258,7 +258,7 @@ void DlgPreferencesImp::applyChanges()
|
||||
catch (const Base::Exception& e) {
|
||||
ui->listBox->setCurrentRow(i);
|
||||
tabWidget->setCurrentIndex(j);
|
||||
QMessageBox::warning(this, tr("Wrong parameter"), QString::fromAscii(e.what()));
|
||||
QMessageBox::warning(this, tr("Wrong parameter"), QString::fromLatin1(e.what()));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
static void addPage(const std::string& className, const std::string& group);
|
||||
static void removePage(const std::string& className, const std::string& group);
|
||||
|
||||
DlgPreferencesImp(QWidget* parent = 0, Qt::WFlags fl = 0);
|
||||
DlgPreferencesImp(QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
~DlgPreferencesImp();
|
||||
|
||||
void accept();
|
||||
|
||||
@@ -44,9 +44,9 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'fl'.
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgProjectInformationImp::DlgProjectInformationImp(App::Document* doc, QWidget* parent, Qt::WFlags fl)
|
||||
DlgProjectInformationImp::DlgProjectInformationImp(App::Document* doc, QWidget* parent, Qt::WindowFlags fl)
|
||||
: QDialog(parent, fl), _doc(doc), ui(new Ui_DlgProjectInformation)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -134,31 +134,31 @@ void DlgProjectInformationImp::onLicenseTypeChanged(int index)
|
||||
{
|
||||
switch (index) {
|
||||
case 0:
|
||||
ui->lineEditLicenseURL->setText(QString::fromAscii("http://en.wikipedia.org/wiki/All_rights_reserved"));
|
||||
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://en.wikipedia.org/wiki/All_rights_reserved"));
|
||||
break;
|
||||
case 1:
|
||||
ui->lineEditLicenseURL->setText(QString::fromAscii("http://creativecommons.org/licenses/by/4.0/"));
|
||||
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://creativecommons.org/licenses/by/4.0/"));
|
||||
break;
|
||||
case 2:
|
||||
ui->lineEditLicenseURL->setText(QString::fromAscii("http://creativecommons.org/licenses/by-sa/4.0/"));
|
||||
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-sa/4.0/"));
|
||||
break;
|
||||
case 3:
|
||||
ui->lineEditLicenseURL->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nd/4.0/"));
|
||||
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nd/4.0/"));
|
||||
break;
|
||||
case 4:
|
||||
ui->lineEditLicenseURL->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nc/4.0/"));
|
||||
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nc/4.0/"));
|
||||
break;
|
||||
case 5:
|
||||
ui->lineEditLicenseURL->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nc-sa/4.0/"));
|
||||
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nc-sa/4.0/"));
|
||||
break;
|
||||
case 6:
|
||||
ui->lineEditLicenseURL->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nc-nd/4.0/"));
|
||||
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nc-nd/4.0/"));
|
||||
break;
|
||||
case 7:
|
||||
ui->lineEditLicenseURL->setText(QString::fromAscii("http://en.wikipedia.org/wiki/Public_domain"));
|
||||
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://en.wikipedia.org/wiki/Public_domain"));
|
||||
break;
|
||||
case 8:
|
||||
ui->lineEditLicenseURL->setText(QString::fromAscii("http://artlibre.org/licence/lal"));
|
||||
ui->lineEditLicenseURL->setText(QString::fromLatin1("http://artlibre.org/licence/lal"));
|
||||
break;
|
||||
default:
|
||||
ui->lineEditLicenseURL->setText(QString::fromUtf8(_doc->LicenseURL.getValue()));
|
||||
|
||||
@@ -40,7 +40,7 @@ class DlgProjectInformationImp : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgProjectInformationImp(App::Document* doc, QWidget* parent = 0, Qt::WFlags fl = 0);
|
||||
DlgProjectInformationImp(App::Document* doc, QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
~DlgProjectInformationImp();
|
||||
void accept();
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ std::string DlgProjectUtility::doctools =
|
||||
|
||||
/* TRANSLATOR Gui::Dialog::DlgProjectUtility */
|
||||
|
||||
DlgProjectUtility::DlgProjectUtility(QWidget* parent, Qt::WFlags fl)
|
||||
DlgProjectUtility::DlgProjectUtility(QWidget* parent, Qt::WindowFlags fl)
|
||||
: QDialog(parent, fl), ui(new Ui_DlgProjectUtility)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -35,7 +35,7 @@ class DlgProjectUtility : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgProjectUtility(QWidget* parent = 0, Qt::WFlags fl = 0);
|
||||
DlgProjectUtility(QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
~DlgProjectUtility();
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
@@ -44,7 +44,7 @@ using namespace Gui::Dialog;
|
||||
|
||||
/* TRANSLATOR Gui::Dialog::DlgPropertyLink */
|
||||
|
||||
DlgPropertyLink::DlgPropertyLink(const QStringList& list, QWidget* parent, Qt::WFlags fl)
|
||||
DlgPropertyLink::DlgPropertyLink(const QStringList& list, QWidget* parent, Qt::WindowFlags fl)
|
||||
: QDialog(parent, fl), link(list), ui(new Ui_DlgPropertyLink)
|
||||
{
|
||||
#ifdef FC_DEBUG
|
||||
|
||||
@@ -34,7 +34,7 @@ class DlgPropertyLink : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgPropertyLink(const QStringList& list, QWidget* parent = 0, Qt::WFlags fl = 0);
|
||||
DlgPropertyLink(const QStringList& list, QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
~DlgPropertyLink();
|
||||
|
||||
void accept();
|
||||
|
||||
@@ -39,7 +39,7 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgReportViewImp::DlgReportViewImp( QWidget* parent )
|
||||
: PreferencePage(parent)
|
||||
|
||||
@@ -44,9 +44,9 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgRunExternal::DlgRunExternal( QWidget* parent, Qt::WFlags fl )
|
||||
DlgRunExternal::DlgRunExternal( QWidget* parent, Qt::WindowFlags fl )
|
||||
: QDialog(parent, fl),process(this),advancedHidden(true)
|
||||
{
|
||||
ui = new Ui_DlgRunExternal();
|
||||
|
||||
@@ -41,7 +41,7 @@ class GuiExport DlgRunExternal : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRunExternal(QWidget* parent = 0, Qt::WFlags fl = 0);
|
||||
DlgRunExternal(QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
virtual ~DlgRunExternal();
|
||||
|
||||
int Do(void);
|
||||
|
||||
@@ -136,20 +136,20 @@ void DlgSettings3DViewImp::on_mouseButton_clicked()
|
||||
QVariant data = comboNavigationStyle->itemData(comboNavigationStyle->currentIndex(), Qt::UserRole);
|
||||
void* instance = Base::Type::createInstanceByName((const char*)data.toByteArray());
|
||||
std::auto_ptr<UserNavigationStyle> ns(static_cast<UserNavigationStyle*>(instance));
|
||||
ui.groupBox->setTitle(ui.groupBox->title()+QString::fromAscii(" ")+comboNavigationStyle->currentText());
|
||||
ui.groupBox->setTitle(ui.groupBox->title()+QString::fromLatin1(" ")+comboNavigationStyle->currentText());
|
||||
QString descr;
|
||||
descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::SELECTION));
|
||||
descr.replace(QLatin1String("\n"), QLatin1String("<p>"));
|
||||
ui.selectionLabel->setText(QString::fromAscii("<b>%1</b>").arg(descr));
|
||||
ui.selectionLabel->setText(QString::fromLatin1("<b>%1</b>").arg(descr));
|
||||
descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::PANNING));
|
||||
descr.replace(QLatin1String("\n"), QLatin1String("<p>"));
|
||||
ui.panningLabel->setText(QString::fromAscii("<b>%1</b>").arg(descr));
|
||||
ui.panningLabel->setText(QString::fromLatin1("<b>%1</b>").arg(descr));
|
||||
descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::DRAGGING));
|
||||
descr.replace(QLatin1String("\n"), QLatin1String("<p>"));
|
||||
ui.rotationLabel->setText(QString::fromAscii("<b>%1</b>").arg(descr));
|
||||
ui.rotationLabel->setText(QString::fromLatin1("<b>%1</b>").arg(descr));
|
||||
descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::ZOOMING));
|
||||
descr.replace(QLatin1String("\n"), QLatin1String("<p>"));
|
||||
ui.zoomingLabel->setText(QString::fromAscii("<b>%1</b>").arg(descr));
|
||||
ui.zoomingLabel->setText(QString::fromLatin1("<b>%1</b>").arg(descr));
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
@@ -181,10 +181,10 @@ void DlgSettings3DViewImp::retranslate()
|
||||
Base::Type::getAllDerivedFrom(UserNavigationStyle::getClassTypeId(), types);
|
||||
comboNavigationStyle->clear();
|
||||
|
||||
QRegExp rx(QString::fromAscii("^\\w+::(\\w+)Navigation\\w+$"));
|
||||
QRegExp rx(QString::fromLatin1("^\\w+::(\\w+)Navigation\\w+$"));
|
||||
for (std::vector<Base::Type>::iterator it = types.begin(); it != types.end(); ++it) {
|
||||
if (*it != UserNavigationStyle::getClassTypeId()) {
|
||||
QString data = QString::fromAscii(it->getName());
|
||||
QString data = QString::fromLatin1(it->getName());
|
||||
QString name = data.mid(data.indexOf(QLatin1String("::"))+2);
|
||||
if (rx.indexIn(data) > -1) {
|
||||
name = tr("%1 navigation").arg(rx.cap(1));
|
||||
|
||||
@@ -43,7 +43,7 @@ using namespace Gui::Dialog;
|
||||
* Constructs a DlgSettingsColorGradientImp as a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgSettingsColorGradientImp::DlgSettingsColorGradientImp( QWidget* parent, Qt::WFlags fl )
|
||||
DlgSettingsColorGradientImp::DlgSettingsColorGradientImp( QWidget* parent, Qt::WindowFlags fl )
|
||||
: QDialog( parent, fl )
|
||||
{
|
||||
this->setupUi(this);
|
||||
|
||||
@@ -41,7 +41,7 @@ class DlgSettingsColorGradientImp : public QDialog, public Ui_DlgSettingsColorGr
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgSettingsColorGradientImp( QWidget* parent = 0, Qt::WFlags fl = 0 );
|
||||
DlgSettingsColorGradientImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 );
|
||||
~DlgSettingsColorGradientImp();
|
||||
|
||||
void accept();
|
||||
|
||||
@@ -132,31 +132,31 @@ void DlgSettingsDocumentImp::onLicenseTypeChanged(int index)
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
prefLicenseUrl->setText(QString::fromAscii("http://en.wikipedia.org/wiki/All_rights_reserved"));
|
||||
prefLicenseUrl->setText(QString::fromLatin1("http://en.wikipedia.org/wiki/All_rights_reserved"));
|
||||
break;
|
||||
case 1:
|
||||
prefLicenseUrl->setText(QString::fromAscii("http://creativecommons.org/licenses/by/4.0/"));
|
||||
prefLicenseUrl->setText(QString::fromLatin1("http://creativecommons.org/licenses/by/4.0/"));
|
||||
break;
|
||||
case 2:
|
||||
prefLicenseUrl->setText(QString::fromAscii("http://creativecommons.org/licenses/by-sa/4.0/"));
|
||||
prefLicenseUrl->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-sa/4.0/"));
|
||||
break;
|
||||
case 3:
|
||||
prefLicenseUrl->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nd/4.0/"));
|
||||
prefLicenseUrl->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nd/4.0/"));
|
||||
break;
|
||||
case 4:
|
||||
prefLicenseUrl->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nc/4.0/"));
|
||||
prefLicenseUrl->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nc/4.0/"));
|
||||
break;
|
||||
case 5:
|
||||
prefLicenseUrl->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nc-sa/4.0/"));
|
||||
prefLicenseUrl->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nc-sa/4.0/"));
|
||||
break;
|
||||
case 6:
|
||||
prefLicenseUrl->setText(QString::fromAscii("http://creativecommons.org/licenses/by-nc-nd/4.0/"));
|
||||
prefLicenseUrl->setText(QString::fromLatin1("http://creativecommons.org/licenses/by-nc-nd/4.0/"));
|
||||
break;
|
||||
case 7:
|
||||
prefLicenseUrl->setText(QString::fromAscii("http://en.wikipedia.org/wiki/Public_domain"));
|
||||
prefLicenseUrl->setText(QString::fromLatin1("http://en.wikipedia.org/wiki/Public_domain"));
|
||||
break;
|
||||
case 8:
|
||||
prefLicenseUrl->setText(QString::fromAscii("http://artlibre.org/licence/lal"));
|
||||
prefLicenseUrl->setText(QString::fromLatin1("http://artlibre.org/licence/lal"));
|
||||
break;
|
||||
default:
|
||||
prefLicenseUrl->clear();
|
||||
|
||||
@@ -48,9 +48,9 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgTipOfTheDayImp::DlgTipOfTheDayImp( QWidget* parent, Qt::WFlags fl )
|
||||
DlgTipOfTheDayImp::DlgTipOfTheDayImp( QWidget* parent, Qt::WindowFlags fl )
|
||||
: QDialog( parent, fl | Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
|
||||
WindowParameter("General")
|
||||
{
|
||||
@@ -104,7 +104,7 @@ void DlgTipOfTheDayImp::onResponseHeaderReceived(const QHttpResponseHeader & res
|
||||
{
|
||||
if (responseHeader.statusCode() != 200) {
|
||||
QString msg = tr("Download failed: %1\n").arg(responseHeader.reasonPhrase());
|
||||
Base::Console().Log(msg.toAscii());
|
||||
Base::Console().Log(msg.toLatin1());
|
||||
_http->abort();
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ void DlgTipOfTheDayImp::onDone(bool err)
|
||||
return;
|
||||
|
||||
// get the page and search for the tips section
|
||||
QString text = QString::fromAscii(_http->readAll());
|
||||
QString text = QString::fromLatin1(_http->readAll());
|
||||
QRegExp rx(QLatin1String("<p>You find the latest information.+<div class=\"printfooter\">"));
|
||||
if (rx.indexIn(text) > -1) {
|
||||
// the text of interest
|
||||
@@ -143,7 +143,7 @@ void DlgTipOfTheDayImp::onStateChanged (int state)
|
||||
break;
|
||||
case QHttp::Closing:
|
||||
case QHttp::Unconnected:
|
||||
Base::Console().Log("%s\n",(const char*)_http->errorString().toAscii());
|
||||
Base::Console().Log("%s\n",(const char*)_http->errorString().toLatin1());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -55,7 +55,7 @@ class DlgTipOfTheDayImp : public QDialog, public Ui_DlgTipOfTheDay, public Windo
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgTipOfTheDayImp( QWidget* parent = 0, Qt::WFlags fl = 0 );
|
||||
DlgTipOfTheDayImp( QWidget* parent = 0, Qt::WindowFlags fl = 0 );
|
||||
~DlgTipOfTheDayImp();
|
||||
|
||||
void reload();
|
||||
|
||||
+18
-18
@@ -64,7 +64,7 @@ struct GroupMap_find {
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent)
|
||||
: CustomizeActionPage(parent), type(t)
|
||||
@@ -113,7 +113,7 @@ DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent)
|
||||
workbenches.sort();
|
||||
index = 1;
|
||||
workbenchBox->addItem(QApplication::windowIcon(), tr("Global"));
|
||||
workbenchBox->setItemData(0, QVariant(QString::fromAscii("Global")), Qt::UserRole);
|
||||
workbenchBox->setItemData(0, QVariant(QString::fromLatin1("Global")), Qt::UserRole);
|
||||
for (QStringList::Iterator it = workbenches.begin(); it != workbenches.end(); ++it) {
|
||||
QPixmap px = Application::Instance->workbenchIcon(*it);
|
||||
QString mt = Application::Instance->workbenchMenuText(*it);
|
||||
@@ -141,7 +141,7 @@ DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent)
|
||||
on_categoryBox_activated(categoryBox->currentIndex());
|
||||
Workbench* w = WorkbenchManager::instance()->active();
|
||||
if (w) {
|
||||
QString name = QString::fromAscii(w->name().c_str());
|
||||
QString name = QString::fromLatin1(w->name().c_str());
|
||||
int index = workbenchBox->findData(name);
|
||||
workbenchBox->setCurrentIndex(index);
|
||||
}
|
||||
@@ -185,7 +185,7 @@ void DlgCustomToolbars::hideEvent(QHideEvent * event)
|
||||
{
|
||||
QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole);
|
||||
QString workbench = data.toString();
|
||||
exportCustomToolbars(workbench.toAscii());
|
||||
exportCustomToolbars(workbench.toLatin1());
|
||||
|
||||
CustomizeActionPage::hideEvent(event);
|
||||
}
|
||||
@@ -197,7 +197,7 @@ void DlgCustomToolbars::on_categoryBox_activated(int index)
|
||||
commandTreeWidget->clear();
|
||||
|
||||
CommandManager & cCmdMgr = Application::Instance->commandManager();
|
||||
std::vector<Command*> aCmds = cCmdMgr.getGroupCommands(group.toAscii());
|
||||
std::vector<Command*> aCmds = cCmdMgr.getGroupCommands(group.toLatin1());
|
||||
|
||||
// Create a separator item
|
||||
QTreeWidgetItem* sepitem = new QTreeWidgetItem(commandTreeWidget);
|
||||
@@ -235,7 +235,7 @@ void DlgCustomToolbars::on_workbenchBox_activated(int index)
|
||||
QString workbench = data.toString();
|
||||
toolbarTreeWidget->clear();
|
||||
|
||||
QByteArray workbenchname = workbench.toAscii();
|
||||
QByteArray workbenchname = workbench.toLatin1();
|
||||
importCustomToolbars(workbenchname);
|
||||
}
|
||||
|
||||
@@ -301,9 +301,9 @@ void DlgCustomToolbars::exportCustomToolbars(const QByteArray& workbench)
|
||||
CommandManager& rMgr = Application::Instance->commandManager();
|
||||
for (int i=0; i<toolbarTreeWidget->topLevelItemCount(); i++) {
|
||||
QTreeWidgetItem* toplevel = toolbarTreeWidget->topLevelItem(i);
|
||||
QString groupName = QString::fromAscii("Custom_%1").arg(i+1);
|
||||
QString groupName = QString::fromLatin1("Custom_%1").arg(i+1);
|
||||
QByteArray toolbarName = toplevel->text(0).toUtf8();
|
||||
ParameterGrp::handle hToolGrp = hGrp->GetGroup(groupName.toAscii());
|
||||
ParameterGrp::handle hToolGrp = hGrp->GetGroup(groupName.toLatin1());
|
||||
hToolGrp->SetASCII("Name", toolbarName.constData());
|
||||
hToolGrp->SetBool("Active", toplevel->checkState(0) == Qt::Checked);
|
||||
|
||||
@@ -352,7 +352,7 @@ void DlgCustomToolbars::on_moveActionRightButton_clicked()
|
||||
|
||||
QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole);
|
||||
QString workbench = data.toString();
|
||||
exportCustomToolbars(workbench.toAscii());
|
||||
exportCustomToolbars(workbench.toLatin1());
|
||||
}
|
||||
|
||||
/** Removes an action */
|
||||
@@ -386,7 +386,7 @@ void DlgCustomToolbars::on_moveActionLeftButton_clicked()
|
||||
|
||||
QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole);
|
||||
QString workbench = data.toString();
|
||||
exportCustomToolbars(workbench.toAscii());
|
||||
exportCustomToolbars(workbench.toLatin1());
|
||||
}
|
||||
|
||||
/** Moves up an action */
|
||||
@@ -424,7 +424,7 @@ void DlgCustomToolbars::on_moveActionUpButton_clicked()
|
||||
|
||||
QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole);
|
||||
QString workbench = data.toString();
|
||||
exportCustomToolbars(workbench.toAscii());
|
||||
exportCustomToolbars(workbench.toLatin1());
|
||||
}
|
||||
|
||||
/** Moves down an action */
|
||||
@@ -462,13 +462,13 @@ void DlgCustomToolbars::on_moveActionDownButton_clicked()
|
||||
|
||||
QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole);
|
||||
QString workbench = data.toString();
|
||||
exportCustomToolbars(workbench.toAscii());
|
||||
exportCustomToolbars(workbench.toLatin1());
|
||||
}
|
||||
|
||||
void DlgCustomToolbars::on_newButton_clicked()
|
||||
{
|
||||
bool ok;
|
||||
QString text = QString::fromAscii("Custom%1").arg(toolbarTreeWidget->topLevelItemCount()+1);
|
||||
QString text = QString::fromLatin1("Custom%1").arg(toolbarTreeWidget->topLevelItemCount()+1);
|
||||
text = QInputDialog::getText(this, tr("New toolbar"), tr("Toolbar name:"), QLineEdit::Normal, text, &ok);
|
||||
if (ok) {
|
||||
// Check for duplicated name
|
||||
@@ -488,7 +488,7 @@ void DlgCustomToolbars::on_newButton_clicked()
|
||||
|
||||
QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole);
|
||||
QString workbench = data.toString();
|
||||
exportCustomToolbars(workbench.toAscii());
|
||||
exportCustomToolbars(workbench.toLatin1());
|
||||
addCustomToolbar(text);
|
||||
}
|
||||
}
|
||||
@@ -505,7 +505,7 @@ void DlgCustomToolbars::on_deleteButton_clicked()
|
||||
|
||||
QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole);
|
||||
QString workbench = data.toString();
|
||||
exportCustomToolbars(workbench.toAscii());
|
||||
exportCustomToolbars(workbench.toLatin1());
|
||||
}
|
||||
|
||||
void DlgCustomToolbars::on_renameButton_clicked()
|
||||
@@ -537,7 +537,7 @@ void DlgCustomToolbars::on_renameButton_clicked()
|
||||
if (renamed) {
|
||||
QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole);
|
||||
QString workbench = data.toString();
|
||||
exportCustomToolbars(workbench.toAscii());
|
||||
exportCustomToolbars(workbench.toLatin1());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -645,7 +645,7 @@ void DlgCustomToolbars::changeEvent(QEvent *e)
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgCustomToolbarsImp::DlgCustomToolbarsImp( QWidget* parent )
|
||||
: DlgCustomToolbars(DlgCustomToolbars::Toolbar, parent)
|
||||
@@ -894,7 +894,7 @@ void DlgCustomToolbarsImp::changeEvent(QEvent *e)
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgCustomToolBoxbarsImp::DlgCustomToolBoxbarsImp( QWidget* parent )
|
||||
: DlgCustomToolbars(DlgCustomToolbars::Toolboxbar, parent)
|
||||
|
||||
@@ -40,9 +40,9 @@ using namespace Gui::Dialog;
|
||||
* name 'name' and widget flags set to 'f'
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WFlags fl )
|
||||
DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WindowFlags fl )
|
||||
: QDialog( parent, fl )
|
||||
{
|
||||
// create widgets
|
||||
@@ -95,7 +95,7 @@ void DlgUnitsCalculator::valueChanged(const Base::Quantity& quant)
|
||||
} else {
|
||||
double value = quant.getValue()/actUnit.getValue();
|
||||
QString val = QLocale::system().toString(value, 'f', Base::UnitsApi::getDecimals());
|
||||
QString out = QString::fromAscii("%1 %2").arg(val).arg(this->UnitInput->text());
|
||||
QString out = QString::fromLatin1("%1 %2").arg(val).arg(this->UnitInput->text());
|
||||
this->ValueOutput->setText(out);
|
||||
this->pushButton_Copy->setEnabled(true);
|
||||
}
|
||||
@@ -128,7 +128,7 @@ void DlgUnitsCalculator::help(void)
|
||||
void DlgUnitsCalculator::returnPressed(void)
|
||||
{
|
||||
if (this->pushButton_Copy->isEnabled()) {
|
||||
this->textEdit->append(this->ValueInput->text() + QString::fromAscii(" = ") + this->ValueOutput->text());
|
||||
this->textEdit->append(this->ValueInput->text() + QString::fromLatin1(" = ") + this->ValueOutput->text());
|
||||
this->ValueInput->pushToHistory();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class DlgUnitsCalculator : public QDialog, public Ui_DlgUnitCalculator
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgUnitsCalculator( QWidget* parent = 0, Qt::WFlags fl = 0 );
|
||||
DlgUnitsCalculator( QWidget* parent = 0, Qt::WindowFlags fl = 0 );
|
||||
~DlgUnitsCalculator();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
using namespace Gui::Dialog;
|
||||
|
||||
const QString DlgWorkbenchesImp::all_workbenches = QString::fromAscii("ALL");
|
||||
const QString DlgWorkbenchesImp::all_workbenches = QString::fromLatin1("ALL");
|
||||
|
||||
/* TRANSLATOR Gui::Dialog::DlgWorkbenchesImp */
|
||||
|
||||
@@ -51,7 +51,7 @@ DlgWorkbenchesImp::DlgWorkbenchesImp(QWidget* parent)
|
||||
this->setupUi(this);
|
||||
set_lw_properties(lw_enabled_workbenches);
|
||||
set_lw_properties(lw_disabled_workbenches);
|
||||
const QString lw_disabled_name = QString::fromAscii("disabled workbenches");
|
||||
const QString lw_disabled_name = QString::fromLatin1("disabled workbenches");
|
||||
lw_disabled_workbenches->setAccessibleName(lw_disabled_name);
|
||||
lw_disabled_workbenches->setSortingEnabled(true);
|
||||
|
||||
@@ -237,22 +237,22 @@ void DlgWorkbenchesImp::save_workbenches()
|
||||
hGrp->Clear();
|
||||
|
||||
if (lw_enabled_workbenches->count() == 0) {
|
||||
enabled_wbs.append(QString::fromAscii("NoneWorkbench"));
|
||||
enabled_wbs.append(QString::fromLatin1("NoneWorkbench"));
|
||||
} else {
|
||||
for (int i = 0; i < lw_enabled_workbenches->count(); i++) {
|
||||
QVariant item_data = lw_enabled_workbenches->item(i)->data(Qt::UserRole);
|
||||
QString name = item_data.toString();
|
||||
enabled_wbs.append(name + QString::fromAscii(","));
|
||||
enabled_wbs.append(name + QString::fromLatin1(","));
|
||||
}
|
||||
}
|
||||
hGrp->SetASCII("Enabled", enabled_wbs.toAscii());
|
||||
hGrp->SetASCII("Enabled", enabled_wbs.toLatin1());
|
||||
|
||||
for (int i = 0; i < lw_disabled_workbenches->count(); i++) {
|
||||
QVariant item_data = lw_disabled_workbenches->item(i)->data(Qt::UserRole);
|
||||
QString name = item_data.toString();
|
||||
disabled_wbs.append(name + QString::fromAscii(","));
|
||||
disabled_wbs.append(name + QString::fromLatin1(","));
|
||||
}
|
||||
hGrp->SetASCII("Disabled", disabled_wbs.toAscii());
|
||||
hGrp->SetASCII("Disabled", disabled_wbs.toLatin1());
|
||||
}
|
||||
|
||||
#include "moc_DlgWorkbenchesImp.cpp"
|
||||
|
||||
@@ -46,7 +46,7 @@ DockWindowItems::~DockWindowItems()
|
||||
void DockWindowItems::addDockWidget(const char* name, Qt::DockWidgetArea pos, bool visibility, bool tabbed)
|
||||
{
|
||||
DockWindowItem item;
|
||||
item.name = QString::fromAscii(name);
|
||||
item.name = QString::fromLatin1(name);
|
||||
item.pos = pos;
|
||||
item.visibility = visibility;
|
||||
item.tabbed = tabbed;
|
||||
@@ -243,7 +243,7 @@ void DockWindowManager::removeDockWindow(QWidget* widget)
|
||||
void DockWindowManager::retranslate()
|
||||
{
|
||||
for (QList<QDockWidget*>::Iterator it = d->_dockedWindows.begin(); it != d->_dockedWindows.end(); ++it) {
|
||||
(*it)->setWindowTitle(QDockWidget::tr((*it)->objectName().toAscii()));
|
||||
(*it)->setWindowTitle(QDockWidget::tr((*it)->objectName().toLatin1()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ void DockWindowManager::setup(DockWindowItems* items)
|
||||
QList<QDockWidget*> areas[4];
|
||||
for (QList<DockWindowItem>::ConstIterator it = dws.begin(); it != dws.end(); ++it) {
|
||||
QDockWidget* dw = findDockWidget(docked, it->name);
|
||||
QByteArray dockName = it->name.toAscii();
|
||||
QByteArray dockName = it->name.toLatin1();
|
||||
bool visible = hPref->GetBool(dockName.constData(), it->visibility);
|
||||
|
||||
if (!dw) {
|
||||
|
||||
@@ -882,7 +882,7 @@ void Document::SaveDocFile (Base::Writer &writer) const
|
||||
d->_pcAppWnd->sendMsgToActiveView("GetCamera",&ppReturn);
|
||||
|
||||
// remove the first line because it's a comment like '#Inventor V2.1 ascii'
|
||||
QStringList lines = QString(QString::fromAscii(ppReturn)).split(QLatin1String("\n"));
|
||||
QStringList lines = QString(QString::fromLatin1(ppReturn)).split(QLatin1String("\n"));
|
||||
if (lines.size() > 1) {
|
||||
lines.pop_front();
|
||||
viewPos = lines.join(QLatin1String(" "));
|
||||
@@ -891,7 +891,7 @@ void Document::SaveDocFile (Base::Writer &writer) const
|
||||
|
||||
writer.incInd(); // indentation for camera settings
|
||||
writer.Stream() << writer.ind() << "<Camera settings=\""
|
||||
<< (const char*)viewPos.toAscii() <<"\"/>" << std::endl;
|
||||
<< (const char*)viewPos.toLatin1() <<"\"/>" << std::endl;
|
||||
writer.decInd(); // indentation for camera settings
|
||||
writer.Stream() << "</Document>" << std::endl;
|
||||
}
|
||||
@@ -1039,7 +1039,7 @@ void Document::createView(const Base::Type& typeId)
|
||||
view3D->getViewer()->addViewProvider(It2->second);
|
||||
|
||||
const char* name = getDocument()->Label.getValue();
|
||||
QString title = QString::fromAscii("%1 : %2[*]")
|
||||
QString title = QString::fromLatin1("%1 : %2[*]")
|
||||
.arg(QString::fromUtf8(name)).arg(d->_iWinCount++);
|
||||
|
||||
view3D->setWindowTitle(title);
|
||||
|
||||
@@ -116,7 +116,7 @@ void DownloadDialog::downloadFile()
|
||||
QByteArray path = QUrl::toPercentEncoding(url.path(), "!$&'()*+,;=:@/");
|
||||
if (path.isEmpty())
|
||||
path = "/";
|
||||
httpGetId = http->get(QString::fromAscii(path), file);
|
||||
httpGetId = http->get(QString::fromLatin1(path), file);
|
||||
|
||||
statusLabel->setText(tr("Downloading %1.").arg(fileName));
|
||||
downloadButton->setEnabled(false);
|
||||
|
||||
@@ -271,7 +271,7 @@ void DownloadItem::init()
|
||||
|
||||
QString DownloadItem::getDownloadDirectory() const
|
||||
{
|
||||
QString exe = QString::fromAscii(App::GetApplication().getExecutableName());
|
||||
QString exe = QString::fromLatin1(App::GetApplication().getExecutableName());
|
||||
QString path = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
|
||||
QString dirPath = QDir(path).filePath(exe);
|
||||
Base::Reference<ParameterGrp> hPath = App::GetApplication().GetUserParameter().GetGroup("BaseApp")
|
||||
@@ -367,12 +367,12 @@ void DownloadItem::open()
|
||||
if (doc) {
|
||||
for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) {
|
||||
Gui::Application::Instance->importFrom(it.key().toUtf8(),
|
||||
doc->getDocument()->getName(), it.value().toAscii());
|
||||
doc->getDocument()->getName(), it.value().toLatin1());
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) {
|
||||
Gui::Application::Instance->open(it.key().toUtf8(), it.value().toAscii());
|
||||
Gui::Application::Instance->open(it.key().toUtf8(), it.value().toLatin1());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ void EditorView::setCurrentFileName(const QString &fileName)
|
||||
if (fileName.isEmpty())
|
||||
shownName = tr("untitled[*]");
|
||||
else
|
||||
shownName = QString::fromAscii("%1[*]").arg(name);
|
||||
shownName = QString::fromLatin1("%1[*]").arg(name);
|
||||
shownName += tr(" - Editor");
|
||||
setWindowTitle(shownName);
|
||||
setWindowModified(false);
|
||||
|
||||
@@ -120,8 +120,8 @@ std::string ExpressionBinding::getEscapedExpressionString() const
|
||||
|
||||
QPixmap ExpressionBinding::getIcon(const char* name, const QSize& size) const
|
||||
{
|
||||
QString key = QString::fromAscii("%1_%2x%3")
|
||||
.arg(QString::fromAscii(name))
|
||||
QString key = QString::fromLatin1("%1_%2x%3")
|
||||
.arg(QString::fromLatin1(name))
|
||||
.arg(size.width())
|
||||
.arg(size.height());
|
||||
QPixmap icon;
|
||||
|
||||
@@ -43,9 +43,9 @@ ExpressionCompleter::ExpressionCompleter(const App::Document * currentDoc, const
|
||||
|
||||
/* Create tree with full path to all objects */
|
||||
while (di != docs.end()) {
|
||||
QStandardItem* docItem = new QStandardItem(QString::fromAscii((*di)->getName()));
|
||||
QStandardItem* docItem = new QStandardItem(QString::fromLatin1((*di)->getName()));
|
||||
|
||||
docItem->setData(QString::fromAscii((*di)->getName()) + QString::fromAscii("#"), Qt::UserRole);
|
||||
docItem->setData(QString::fromLatin1((*di)->getName()) + QString::fromLatin1("#"), Qt::UserRole);
|
||||
createModelForDocument(*di, docItem, forbidden);
|
||||
|
||||
model->appendRow(docItem);
|
||||
@@ -90,9 +90,9 @@ void ExpressionCompleter::createModelForDocument(const App::Document * doc, QSta
|
||||
continue;
|
||||
}
|
||||
|
||||
QStandardItem* docObjItem = new QStandardItem(QString::fromAscii((*doi)->getNameInDocument()));
|
||||
QStandardItem* docObjItem = new QStandardItem(QString::fromLatin1((*doi)->getNameInDocument()));
|
||||
|
||||
docObjItem->setData(QString::fromAscii((*doi)->getNameInDocument()) + QString::fromAscii("."), Qt::UserRole);
|
||||
docObjItem->setData(QString::fromLatin1((*doi)->getNameInDocument()) + QString::fromLatin1("."), Qt::UserRole);
|
||||
createModelForDocumentObject(*doi, docObjItem);
|
||||
parent->appendRow(docObjItem);
|
||||
|
||||
@@ -104,7 +104,7 @@ void ExpressionCompleter::createModelForDocument(const App::Document * doc, QSta
|
||||
|
||||
docObjItem = new QStandardItem(QString::fromUtf8(label.c_str()));
|
||||
|
||||
docObjItem->setData( QString::fromUtf8(label.c_str()) + QString::fromAscii("."), Qt::UserRole);
|
||||
docObjItem->setData( QString::fromUtf8(label.c_str()) + QString::fromLatin1("."), Qt::UserRole);
|
||||
createModelForDocumentObject(*doi, docObjItem);
|
||||
parent->appendRow(docObjItem);
|
||||
}
|
||||
|
||||
+13
-13
@@ -366,7 +366,7 @@ void FileDialog::setWorkingDirectory(const QString& dir)
|
||||
|
||||
/* TRANSLATOR Gui::FileOptionsDialog */
|
||||
|
||||
FileOptionsDialog::FileOptionsDialog( QWidget* parent, Qt::WFlags fl )
|
||||
FileOptionsDialog::FileOptionsDialog( QWidget* parent, Qt::WindowFlags fl )
|
||||
: QFileDialog( parent, fl )
|
||||
{
|
||||
extensionButton = new QPushButton( this );
|
||||
@@ -433,7 +433,7 @@ void FileOptionsDialog::accept()
|
||||
if (ext.isEmpty())
|
||||
setDefaultSuffix(suf);
|
||||
else if (ext.toLower() != suf.toLower()) {
|
||||
fn = QString::fromAscii("%1.%2").arg(fn).arg(suf);
|
||||
fn = QString::fromLatin1("%1.%2").arg(fn).arg(suf);
|
||||
selectFile(fn);
|
||||
}
|
||||
}
|
||||
@@ -709,7 +709,7 @@ SelectModule::SelectModule (const QString& type, const SelectModule::Dict& types
|
||||
module = module.left(pos);
|
||||
}
|
||||
|
||||
button->setText(QString::fromAscii("%1 (%2)").arg(filter).arg(module));
|
||||
button->setText(QString::fromLatin1("%1 (%2)").arg(filter).arg(module));
|
||||
button->setObjectName(it.value());
|
||||
gridLayout1->addWidget(button, index, 0, 1, 1);
|
||||
group->addButton(button, index);
|
||||
@@ -784,7 +784,7 @@ SelectModule::Dict SelectModule::exportHandler(const QStringList& fileNames, con
|
||||
std::map<std::string, std::string>::const_iterator it;
|
||||
it = filterList.find((const char*)filter.toUtf8());
|
||||
if (it != filterList.end()) {
|
||||
QString module = QString::fromAscii(it->second.c_str());
|
||||
QString module = QString::fromLatin1(it->second.c_str());
|
||||
for (QStringList::const_iterator it = fileNames.begin(); it != fileNames.end(); ++it) {
|
||||
dict[*it] = module;
|
||||
}
|
||||
@@ -799,19 +799,19 @@ SelectModule::Dict SelectModule::exportHandler(const QStringList& fileNames, con
|
||||
for (QStringList::const_iterator it = fileNames.begin(); it != fileNames.end(); ++it) {
|
||||
QFileInfo fi(*it);
|
||||
QString ext = fi.completeSuffix().toLower();
|
||||
std::map<std::string, std::string> filters = App::GetApplication().getExportFilters(ext.toAscii());
|
||||
std::map<std::string, std::string> filters = App::GetApplication().getExportFilters(ext.toLatin1());
|
||||
|
||||
if (filters.empty()) {
|
||||
ext = fi.suffix().toLower();
|
||||
filters = App::GetApplication().getExportFilters(ext.toAscii());
|
||||
filters = App::GetApplication().getExportFilters(ext.toLatin1());
|
||||
}
|
||||
|
||||
fileExtension[ext].push_back(*it);
|
||||
for (std::map<std::string, std::string>::iterator jt = filters.begin(); jt != filters.end(); ++jt)
|
||||
filetypeHandler[ext][QString::fromUtf8(jt->first.c_str())] = QString::fromAscii(jt->second.c_str());
|
||||
filetypeHandler[ext][QString::fromUtf8(jt->first.c_str())] = QString::fromLatin1(jt->second.c_str());
|
||||
// set the default module handler
|
||||
if (!filters.empty())
|
||||
dict[*it] = QString::fromAscii(filters.begin()->second.c_str());
|
||||
dict[*it] = QString::fromLatin1(filters.begin()->second.c_str());
|
||||
}
|
||||
|
||||
for (QMap<QString, SelectModule::Dict>::const_iterator it = filetypeHandler.begin();
|
||||
@@ -846,7 +846,7 @@ SelectModule::Dict SelectModule::importHandler(const QStringList& fileNames, con
|
||||
std::map<std::string, std::string>::const_iterator it;
|
||||
it = filterList.find((const char*)filter.toUtf8());
|
||||
if (it != filterList.end()) {
|
||||
QString module = QString::fromAscii(it->second.c_str());
|
||||
QString module = QString::fromLatin1(it->second.c_str());
|
||||
for (QStringList::const_iterator it = fileNames.begin(); it != fileNames.end(); ++it) {
|
||||
dict[*it] = module;
|
||||
}
|
||||
@@ -861,19 +861,19 @@ SelectModule::Dict SelectModule::importHandler(const QStringList& fileNames, con
|
||||
for (QStringList::const_iterator it = fileNames.begin(); it != fileNames.end(); ++it) {
|
||||
QFileInfo fi(*it);
|
||||
QString ext = fi.completeSuffix().toLower();
|
||||
std::map<std::string, std::string> filters = App::GetApplication().getImportFilters(ext.toAscii());
|
||||
std::map<std::string, std::string> filters = App::GetApplication().getImportFilters(ext.toLatin1());
|
||||
|
||||
if (filters.empty()) {
|
||||
ext = fi.suffix().toLower();
|
||||
filters = App::GetApplication().getImportFilters(ext.toAscii());
|
||||
filters = App::GetApplication().getImportFilters(ext.toLatin1());
|
||||
}
|
||||
|
||||
fileExtension[ext].push_back(*it);
|
||||
for (std::map<std::string, std::string>::iterator jt = filters.begin(); jt != filters.end(); ++jt)
|
||||
filetypeHandler[ext][QString::fromUtf8(jt->first.c_str())] = QString::fromAscii(jt->second.c_str());
|
||||
filetypeHandler[ext][QString::fromUtf8(jt->first.c_str())] = QString::fromLatin1(jt->second.c_str());
|
||||
// set the default module handler
|
||||
if (!filters.empty())
|
||||
dict[*it] = QString::fromAscii(filters.begin()->second.c_str());
|
||||
dict[*it] = QString::fromLatin1(filters.begin()->second.c_str());
|
||||
}
|
||||
|
||||
for (QMap<QString, SelectModule::Dict>::const_iterator it = filetypeHandler.begin();
|
||||
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
ExtensionBottom = 1
|
||||
};
|
||||
|
||||
FileOptionsDialog ( QWidget* parent, Qt::WFlags );
|
||||
FileOptionsDialog ( QWidget* parent, Qt::WindowFlags );
|
||||
virtual ~FileOptionsDialog();
|
||||
|
||||
void accept();
|
||||
|
||||
@@ -192,7 +192,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||
const int button = event->getButton();
|
||||
const SbBool press //the button was pressed (if false -> released)
|
||||
= event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
= event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
switch (button) {
|
||||
case SoMouseButtonEvent::BUTTON1:
|
||||
this->button1down = press;
|
||||
@@ -268,7 +268,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
|
||||
//----------all this were preparations. Now comes the event handling! ----------
|
||||
|
||||
SbBool processed = FALSE;//a return value for the BlahblahblahNavigationStyle::processSoEvent
|
||||
SbBool processed = false;//a return value for the BlahblahblahNavigationStyle::processSoEvent
|
||||
bool propagated = false;//an internal flag indicating that the event has been already passed to inherited, to suppress the automatic doing of this at the end.
|
||||
//goto finalize = return processed. Might be important to do something before done (none now).
|
||||
|
||||
@@ -282,10 +282,10 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
// Mode-independent keyboard handling
|
||||
if (evIsKeyboard) {
|
||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
switch (event->getKey()) {
|
||||
case SoKeyboardEvent::H:
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
if(!press){
|
||||
SbBool ret = NavigationStyle::lookAtPoint(event->getPosition());
|
||||
if(!ret){
|
||||
@@ -306,7 +306,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||
if (event)
|
||||
this->processMotionEvent(event);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
if (processed)
|
||||
goto finalize;
|
||||
@@ -321,7 +321,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
//keyboard
|
||||
if (evIsKeyboard) {
|
||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
|
||||
switch(event->getKey()){
|
||||
case SoKeyboardEvent::S:
|
||||
@@ -335,15 +335,15 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
break;
|
||||
case SoKeyboardEvent::PAGE_UP:
|
||||
if(press){
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||
}
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
break;
|
||||
case SoKeyboardEvent::PAGE_DOWN:
|
||||
if(press){
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||
}
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -358,7 +358,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||
const int button = event->getButton();
|
||||
const SbBool press //the button was pressed (if false -> released)
|
||||
= event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
= event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
switch(button){
|
||||
case SoMouseButtonEvent::BUTTON1:
|
||||
case SoMouseButtonEvent::BUTTON2:
|
||||
@@ -399,7 +399,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
}
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON3://press the wheel
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
if(press){
|
||||
SbBool ret = NavigationStyle::lookAtPoint(event->getPosition());
|
||||
if(!ret){
|
||||
@@ -409,12 +409,12 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
}
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON4: //(wheel?)
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
||||
processed = TRUE;
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||
processed = true;
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON5: //(wheel?)
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
||||
processed = TRUE;
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||
processed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -479,7 +479,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||
const int button = event->getButton();
|
||||
//const SbBool press //the button was pressed (if false -> released)
|
||||
// = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
// = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
switch(button){
|
||||
case SoMouseButtonEvent::BUTTON1:
|
||||
case SoMouseButtonEvent::BUTTON2:
|
||||
@@ -502,23 +502,23 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
//const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
||||
if (curmode == NavigationStyle::ZOOMING) {//doesn't happen
|
||||
this->zoomByCursor(posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
} else if (curmode == NavigationStyle::PANNING) {
|
||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
} else if (curmode == NavigationStyle::DRAGGING) {
|
||||
if (comboAfter & BUTTON1DOWN && comboAfter & BUTTON2DOWN) {
|
||||
//two mouse buttons down - tilting!
|
||||
NavigationStyle::doRotate(viewer->getSoRenderManager()->getCamera(),
|
||||
(posn - prevnormalized)[0]*(-2),
|
||||
SbVec2f(0.5,0.5));
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
} else {//one mouse button - normal spinning
|
||||
//this will also handle the single-finger drag (there's no gesture used, pseudomouse is enough)
|
||||
//this->addToLog(event->getPosition(), event->getTime());
|
||||
this->spin_simplified(viewer->getSoRenderManager()->getCamera(),
|
||||
posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -564,7 +564,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (evIsButton) {
|
||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||
const int button = event->getButton();
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
if (button == SoMouseButtonEvent::BUTTON1 && press) {
|
||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||
this->setViewingMode(NavigationStyle::SEEK_MODE);
|
||||
|
||||
@@ -165,9 +165,9 @@ void GraphvizView::updateSvgItem(const App::Document &doc)
|
||||
#endif
|
||||
bool pathChanged = false;
|
||||
#ifdef FC_OS_WIN32
|
||||
QString exe = QString::fromAscii("\"%1/dot\"").arg(path);
|
||||
QString exe = QString::fromLatin1("\"%1/dot\"").arg(path);
|
||||
#else
|
||||
QString exe = QString::fromAscii("%1/dot").arg(path);
|
||||
QString exe = QString::fromLatin1("%1/dot").arg(path);
|
||||
#endif
|
||||
proc->setEnvironment(QProcess::systemEnvironment());
|
||||
do {
|
||||
@@ -190,9 +190,9 @@ void GraphvizView::updateSvgItem(const App::Document &doc)
|
||||
}
|
||||
pathChanged = true;
|
||||
#ifdef FC_OS_WIN32
|
||||
exe = QString::fromAscii("\"%1/dot\"").arg(path);
|
||||
exe = QString::fromLatin1("\"%1/dot\"").arg(path);
|
||||
#else
|
||||
exe = QString::fromAscii("%1/dot").arg(path);
|
||||
exe = QString::fromLatin1("%1/dot").arg(path);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
@@ -266,9 +266,9 @@ QByteArray GraphvizView::exportGraph(const QString& format)
|
||||
#endif
|
||||
|
||||
#ifdef FC_OS_WIN32
|
||||
QString exe = QString::fromAscii("\"%1/dot\"").arg(path);
|
||||
QString exe = QString::fromLatin1("\"%1/dot\"").arg(path);
|
||||
#else
|
||||
QString exe = QString::fromAscii("%1/dot").arg(path);
|
||||
QString exe = QString::fromLatin1("%1/dot").arg(path);
|
||||
#endif
|
||||
proc.setEnvironment(QProcess::systemEnvironment());
|
||||
proc.start(exe, args);
|
||||
|
||||
@@ -95,8 +95,8 @@ TextBrowser::TextBrowser(QWidget * parent)
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
||||
setAcceptDrops( TRUE );
|
||||
viewport()->setAcceptDrops( TRUE );
|
||||
setAcceptDrops( true );
|
||||
viewport()->setAcceptDrops( true );
|
||||
|
||||
connect( d->http, SIGNAL(done(bool)), this, SLOT(done(bool)));
|
||||
connect( d->http, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int)));
|
||||
@@ -208,7 +208,7 @@ QVariant TextBrowser::loadFileResource(int type, const QUrl& name)
|
||||
data = file.readAll();
|
||||
file.close();
|
||||
} else if (type == QTextDocument::HtmlResource) {
|
||||
data = QString::fromAscii(
|
||||
data = QString::fromLatin1(
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">"
|
||||
"<html>"
|
||||
"<head>"
|
||||
@@ -306,7 +306,7 @@ QVariant TextBrowser::loadHttpResource(int type, const QUrl& name)
|
||||
return d->http->readAll();
|
||||
} else {
|
||||
if (type == QTextDocument::HtmlResource) {
|
||||
data = QString::fromAscii(
|
||||
data = QString::fromLatin1(
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">"
|
||||
"<html>"
|
||||
"<head>"
|
||||
@@ -469,12 +469,12 @@ void TextBrowser::dropEvent(QDropEvent * e)
|
||||
dataStream >> action;
|
||||
|
||||
CommandManager& rclMan = Application::Instance->commandManager();
|
||||
Command* pCmd = rclMan.getCommandByName(action.toAscii());
|
||||
Command* pCmd = rclMan.getCommandByName(action.toLatin1());
|
||||
if ( pCmd ) {
|
||||
QString info = pCmd->getAction()->whatsThis();
|
||||
if ( !info.isEmpty() ) {
|
||||
// cannot show help to this command
|
||||
info = QString::fromAscii(
|
||||
info = QString::fromLatin1(
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"
|
||||
"<html>"
|
||||
"<body bgcolor=white text=black alink=red link=darkblue vlink=darkmagenta>"
|
||||
@@ -482,7 +482,7 @@ void TextBrowser::dropEvent(QDropEvent * e)
|
||||
"</body>"
|
||||
"</html>" ).arg( info );
|
||||
} else {
|
||||
info = QString::fromAscii(
|
||||
info = QString::fromLatin1(
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"
|
||||
"<html>"
|
||||
"<body bgcolor=white text=black alink=red link=darkblue vlink=darkmagenta>"
|
||||
|
||||
+10
-10
@@ -79,11 +79,11 @@ InputField::InputField(QWidget * parent)
|
||||
iconLabel->setCursor(Qt::ArrowCursor);
|
||||
QPixmap pixmap = getValidationIcon(":/icons/button_valid.svg", QSize(sizeHint().height(),sizeHint().height()));
|
||||
iconLabel->setPixmap(pixmap);
|
||||
iconLabel->setStyleSheet(QString::fromAscii("QLabel { border: none; padding: 0px; }"));
|
||||
iconLabel->setStyleSheet(QString::fromLatin1("QLabel { border: none; padding: 0px; }"));
|
||||
iconLabel->hide();
|
||||
connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateIconLabel(const QString&)));
|
||||
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
|
||||
setStyleSheet(QString::fromAscii("QLineEdit { padding-right: %1px } ").arg(iconLabel->sizeHint().width() + frameWidth + 1));
|
||||
setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconLabel->sizeHint().width() + frameWidth + 1));
|
||||
QSize msz = minimumSizeHint();
|
||||
setMinimumSize(qMax(msz.width(), iconLabel->sizeHint().height() + frameWidth * 2 + 2),
|
||||
qMax(msz.height(), iconLabel->sizeHint().height() + frameWidth * 2 + 2));
|
||||
@@ -137,8 +137,8 @@ bool InputField::apply()
|
||||
|
||||
QPixmap InputField::getValidationIcon(const char* name, const QSize& size) const
|
||||
{
|
||||
QString key = QString::fromAscii("%1_%2x%3")
|
||||
.arg(QString::fromAscii(name))
|
||||
QString key = QString::fromLatin1("%1_%2x%3")
|
||||
.arg(QString::fromLatin1(name))
|
||||
.arg(size.width())
|
||||
.arg(size.height());
|
||||
QPixmap icon;
|
||||
@@ -185,7 +185,7 @@ void InputField::contextMenuEvent(QContextMenuEvent *event)
|
||||
{
|
||||
QMenu *editMenu = createStandardContextMenu();
|
||||
editMenu->setTitle(tr("Edit"));
|
||||
QMenu* menu = new QMenu(QString::fromAscii("InputFieldContextmenu"));
|
||||
QMenu* menu = new QMenu(QString::fromLatin1("InputFieldContextmenu"));
|
||||
|
||||
menu->addMenu(editMenu);
|
||||
menu->addSeparator();
|
||||
@@ -253,10 +253,10 @@ void InputField::newInput(const QString & text)
|
||||
}
|
||||
catch(Base::Exception &e){
|
||||
ErrorText = e.what();
|
||||
this->setToolTip(QString::fromAscii(ErrorText.c_str()));
|
||||
this->setToolTip(QString::fromLatin1(ErrorText.c_str()));
|
||||
QPixmap pixmap = getValidationIcon(":/icons/button_invalid.svg", QSize(sizeHint().height(),sizeHint().height()));
|
||||
iconLabel->setPixmap(pixmap);
|
||||
parseError(QString::fromAscii(ErrorText.c_str()));
|
||||
parseError(QString::fromLatin1(ErrorText.c_str()));
|
||||
validInput = false;
|
||||
return;
|
||||
}
|
||||
@@ -266,10 +266,10 @@ void InputField::newInput(const QString & text)
|
||||
|
||||
// check if unit fits!
|
||||
if(!actUnit.isEmpty() && !res.getUnit().isEmpty() && actUnit != res.getUnit()){
|
||||
this->setToolTip(QString::fromAscii("Wrong unit"));
|
||||
this->setToolTip(QString::fromLatin1("Wrong unit"));
|
||||
QPixmap pixmap = getValidationIcon(":/icons/button_invalid.svg", QSize(sizeHint().height(),sizeHint().height()));
|
||||
iconLabel->setPixmap(pixmap);
|
||||
parseError(QString::fromAscii("Wrong unit"));
|
||||
parseError(QString::fromLatin1("Wrong unit"));
|
||||
validInput = false;
|
||||
return;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ void InputField::newInput(const QString & text)
|
||||
ErrorText = "Minimum reached";
|
||||
}
|
||||
|
||||
this->setToolTip(QString::fromAscii(ErrorText.c_str()));
|
||||
this->setToolTip(QString::fromLatin1(ErrorText.c_str()));
|
||||
|
||||
double dFactor;
|
||||
res.getUserString(dFactor,actUnitStr);
|
||||
|
||||
@@ -157,7 +157,7 @@ void LocationWidget::setDirection(const Base::Vector3d& dir)
|
||||
}
|
||||
|
||||
// add a new item before the very last item
|
||||
QString display = QString::fromAscii("(%1,%2,%3)")
|
||||
QString display = QString::fromLatin1("(%1,%2,%3)")
|
||||
.arg(dir.x)
|
||||
.arg(dir.y)
|
||||
.arg(dir.z);
|
||||
@@ -219,7 +219,7 @@ void LocationWidget::on_direction_activated(int index)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
LocationDialog::LocationDialog(QWidget* parent, Qt::WFlags fl)
|
||||
LocationDialog::LocationDialog(QWidget* parent, Qt::WindowFlags fl)
|
||||
: QDialog(parent, fl)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class GuiExport LocationDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
LocationDialog(QWidget* parent = 0, Qt::WFlags fl = 0);
|
||||
LocationDialog(QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
virtual ~LocationDialog();
|
||||
|
||||
protected:
|
||||
@@ -113,7 +113,7 @@ template <class Ui>
|
||||
class LocationInterface : public LocationDialog, public Ui
|
||||
{
|
||||
public:
|
||||
LocationInterface(QWidget* parent = 0, Qt::WFlags fl = 0) : LocationDialog(parent, fl)
|
||||
LocationInterface(QWidget* parent = 0, Qt::WindowFlags fl = 0) : LocationDialog(parent, fl)
|
||||
{
|
||||
this->setupUi(this);
|
||||
this->retranslate();
|
||||
@@ -209,7 +209,7 @@ private:
|
||||
}
|
||||
|
||||
// add a new item before the very last item
|
||||
QString display = QString::fromAscii("(%1,%2,%3)")
|
||||
QString display = QString::fromLatin1("(%1,%2,%3)")
|
||||
.arg(dir.x)
|
||||
.arg(dir.y)
|
||||
.arg(dir.z);
|
||||
@@ -320,7 +320,7 @@ public:
|
||||
}
|
||||
|
||||
// add a new item before the very last item
|
||||
QString display = QString::fromAscii("(%1,%2,%3)")
|
||||
QString display = QString::fromLatin1("(%1,%2,%3)")
|
||||
.arg(dir.x)
|
||||
.arg(dir.y)
|
||||
.arg(dir.z);
|
||||
@@ -359,7 +359,7 @@ template <class Ui>
|
||||
class LocationDialogComp : public LocationDialog
|
||||
{
|
||||
public:
|
||||
LocationDialogComp(QWidget* parent = 0, Qt::WFlags fl = 0)
|
||||
LocationDialogComp(QWidget* parent = 0, Qt::WindowFlags fl = 0)
|
||||
: LocationDialog(parent, fl), ui(this)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -98,11 +98,11 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
|
||||
this->lastmouseposition = posn;
|
||||
|
||||
// Set to TRUE if any event processing happened. Note that it is not
|
||||
// Set to true if any event processing happened. Note that it is not
|
||||
// necessary to restrict ourselves to only do one "action" for an
|
||||
// event, we only need this flag to see if any processing happened
|
||||
// at all.
|
||||
SbBool processed = FALSE;
|
||||
SbBool processed = false;
|
||||
|
||||
const ViewerMode curmode = this->currentmode;
|
||||
ViewerMode newmode = curmode;
|
||||
@@ -123,13 +123,13 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (!processed && !viewer->isEditing()) {
|
||||
processed = handleEventInForeground(ev);
|
||||
if (processed)
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Keyboard handling
|
||||
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
switch (event->getKey()) {
|
||||
case SoKeyboardEvent::LEFT_CONTROL:
|
||||
case SoKeyboardEvent::RIGHT_CONTROL:
|
||||
@@ -144,7 +144,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
this->altdown = press;
|
||||
break;
|
||||
case SoKeyboardEvent::H:
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
viewer->saveHomePosition();
|
||||
break;
|
||||
case SoKeyboardEvent::S:
|
||||
@@ -165,7 +165,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||
const int button = event->getButton();
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
|
||||
// SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
||||
switch (button) {
|
||||
@@ -177,7 +177,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
||||
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
||||
this->lockrecenter = FALSE;
|
||||
this->lockrecenter = false;
|
||||
}
|
||||
else if (!press && ev->wasShiftDown() &&
|
||||
(this->currentmode != NavigationStyle::SELECTION)) {
|
||||
@@ -189,34 +189,34 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
panToCenter(panningplane, posn);
|
||||
this->interactiveCountDec();
|
||||
}
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
else if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
||||
newmode = NavigationStyle::SEEK_MODE;
|
||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||
processed = TRUE;
|
||||
this->lockrecenter = TRUE;
|
||||
processed = true;
|
||||
this->lockrecenter = true;
|
||||
}
|
||||
else if (press && (this->currentmode == NavigationStyle::IDLE)) {
|
||||
this->setViewing(true);
|
||||
processed = TRUE;
|
||||
this->lockrecenter = TRUE;
|
||||
processed = true;
|
||||
this->lockrecenter = true;
|
||||
}
|
||||
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
||||
this->setViewing(false);
|
||||
processed = TRUE;
|
||||
this->lockrecenter = TRUE;
|
||||
processed = true;
|
||||
this->lockrecenter = true;
|
||||
}
|
||||
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
||||
processed = TRUE;
|
||||
this->lockrecenter = TRUE;
|
||||
processed = true;
|
||||
this->lockrecenter = true;
|
||||
}
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON2:
|
||||
// If we are in edit mode then simply ignore the RMB events
|
||||
// to pass the event to the base class.
|
||||
this->lockrecenter = TRUE;
|
||||
this->lockrecenter = true;
|
||||
if (!viewer->isEditing()) {
|
||||
// If we are in zoom or pan mode ignore RMB events otherwise
|
||||
// the canvas doesn't get any release events
|
||||
@@ -237,7 +237,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
||||
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
||||
this->lockrecenter = FALSE;
|
||||
this->lockrecenter = false;
|
||||
}
|
||||
else {
|
||||
SbTime tmp = (ev->getTime() - this->centerTime);
|
||||
@@ -248,18 +248,18 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
panToCenter(panningplane, posn);
|
||||
this->interactiveCountDec();
|
||||
}
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
this->button3down = press;
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON4:
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
||||
processed = TRUE;
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||
processed = true;
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON5:
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
||||
processed = TRUE;
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||
processed = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -268,22 +268,22 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
|
||||
// Mouse Movement handling
|
||||
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
||||
this->lockrecenter = TRUE;
|
||||
this->lockrecenter = true;
|
||||
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
||||
if (this->currentmode == NavigationStyle::ZOOMING) {
|
||||
this->zoomByCursor(posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (this->currentmode == NavigationStyle::PANNING) {
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
||||
this->addToLog(event->getPosition(), event->getTime());
|
||||
this->spin(posn);
|
||||
moveCursorPosition();
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||
if (event)
|
||||
this->processMotionEvent(event);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
|
||||
enum {
|
||||
@@ -370,7 +370,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
viewer->isEditing()) && !processed)
|
||||
processed = inherited::processSoEvent(ev);
|
||||
else
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return processed;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ TStringList Translator::supportedLanguages() const
|
||||
QDir dir(QLatin1String(":/translations"));
|
||||
for (std::map<std::string,std::string>::const_iterator it = d->mapLanguageTopLevelDomain.begin();
|
||||
it != d->mapLanguageTopLevelDomain.end(); ++it) {
|
||||
QString filter = QString::fromAscii("*_%1.qm").arg(QLatin1String(it->second.c_str()));
|
||||
QString filter = QString::fromLatin1("*_%1.qm").arg(QLatin1String(it->second.c_str()));
|
||||
QStringList fileNames = dir.entryList(QStringList(filter), QDir::Files, QDir::Name);
|
||||
if (!fileNames.isEmpty())
|
||||
languages.push_back(it->first);
|
||||
@@ -187,7 +187,7 @@ TStringMap Translator::supportedLocales() const
|
||||
QDir dir(QLatin1String(":/translations"));
|
||||
for (std::map<std::string,std::string>::const_iterator it = d->mapLanguageTopLevelDomain.begin();
|
||||
it != d->mapLanguageTopLevelDomain.end(); ++it) {
|
||||
QString filter = QString::fromAscii("*_%1.qm").arg(QLatin1String(it->second.c_str()));
|
||||
QString filter = QString::fromLatin1("*_%1.qm").arg(QLatin1String(it->second.c_str()));
|
||||
QStringList fileNames = dir.entryList(QStringList(filter), QDir::Files, QDir::Name);
|
||||
if (!fileNames.isEmpty())
|
||||
languages[it->first] = it->second;
|
||||
@@ -239,7 +239,7 @@ void Translator::addPath(const QString& path)
|
||||
|
||||
void Translator::installQMFiles(const QDir& dir, const char* locale)
|
||||
{
|
||||
QString filter = QString::fromAscii("*_%1.qm").arg(QLatin1String(locale));
|
||||
QString filter = QString::fromLatin1("*_%1.qm").arg(QLatin1String(locale));
|
||||
QStringList fileNames = dir.entryList(QStringList(filter), QDir::Files, QDir::Name);
|
||||
for (QStringList::Iterator it = fileNames.begin(); it != fileNames.end(); ++it){
|
||||
bool ok=false;
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@ using namespace Gui;
|
||||
TYPESYSTEM_SOURCE_ABSTRACT(Gui::MDIView,Gui::BaseView);
|
||||
|
||||
|
||||
MDIView::MDIView(Gui::Document* pcDocument,QWidget* parent, Qt::WFlags wflags)
|
||||
MDIView::MDIView(Gui::Document* pcDocument,QWidget* parent, Qt::WindowFlags wflags)
|
||||
: QMainWindow(parent, wflags), BaseView(pcDocument),currentMode(Child), wstate(Qt::WindowNoState)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
@@ -115,7 +115,7 @@ void MDIView::onRelabel(Gui::Document *pDoc)
|
||||
}
|
||||
else {
|
||||
cap = QString::fromUtf8(pDoc->getDocument()->Label.getValue());
|
||||
cap = QString::fromAscii("%1[*]").arg(cap);
|
||||
cap = QString::fromLatin1("%1[*]").arg(cap);
|
||||
setWindowTitle(cap);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ public:
|
||||
* the view will attach to the active document. Be aware, there isn't
|
||||
* always an active document.
|
||||
*/
|
||||
MDIView(Gui::Document* pcDocument, QWidget* parent, Qt::WFlags wflags=0);
|
||||
MDIView(Gui::Document* pcDocument, QWidget* parent, Qt::WindowFlags wflags=0);
|
||||
/** View destructor
|
||||
* Detach the view from the document, if attached.
|
||||
*/
|
||||
|
||||
+8
-8
@@ -100,7 +100,7 @@ void MacroManager::commit(void)
|
||||
// sort import lines and avoid duplicates
|
||||
QTextStream str(&file);
|
||||
QStringList import;
|
||||
import << QString::fromAscii("import FreeCAD");
|
||||
import << QString::fromLatin1("import FreeCAD");
|
||||
QStringList body;
|
||||
|
||||
QStringList::Iterator it;
|
||||
@@ -119,14 +119,14 @@ void MacroManager::commit(void)
|
||||
}
|
||||
|
||||
QString header;
|
||||
header += QString::fromAscii("# -*- coding: utf-8 -*-\n\n");
|
||||
header += QString::fromAscii("# Macro Begin: ");
|
||||
header += QString::fromLatin1("# -*- coding: utf-8 -*-\n\n");
|
||||
header += QString::fromLatin1("# Macro Begin: ");
|
||||
header += this->macroName;
|
||||
header += QString::fromAscii(" +++++++++++++++++++++++++++++++++++++++++++++++++\n");
|
||||
header += QString::fromLatin1(" +++++++++++++++++++++++++++++++++++++++++++++++++\n");
|
||||
|
||||
QString footer = QString::fromAscii("# Macro End: ");
|
||||
QString footer = QString::fromLatin1("# Macro End: ");
|
||||
footer += this->macroName;
|
||||
footer += QString::fromAscii(" +++++++++++++++++++++++++++++++++++++++++++++++++\n");
|
||||
footer += QString::fromLatin1(" +++++++++++++++++++++++++++++++++++++++++++++++++\n");
|
||||
|
||||
// write the data to the text file
|
||||
str << header;
|
||||
@@ -173,7 +173,7 @@ void MacroManager::addLine(LineType Type, const char* sLine)
|
||||
comment = true;
|
||||
}
|
||||
|
||||
QStringList lines = QString::fromAscii(sLine).split(QLatin1String("\n"));
|
||||
QStringList lines = QString::fromLatin1(sLine).split(QLatin1String("\n"));
|
||||
if (comment) {
|
||||
for (QStringList::iterator it = lines.begin(); it != lines.end(); ++it)
|
||||
it->prepend(QLatin1String("#"));
|
||||
@@ -195,7 +195,7 @@ void MacroManager::setModule(const char* sModule)
|
||||
{
|
||||
if (this->openMacro && sModule && *sModule != '\0')
|
||||
{
|
||||
this->macroInProgress.append(QString::fromAscii("import %1").arg(QString::fromAscii(sModule)));
|
||||
this->macroInProgress.append(QString::fromLatin1("import %1").arg(QString::fromLatin1(sModule)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+49
-49
@@ -236,7 +236,7 @@ protected:
|
||||
|
||||
/* TRANSLATOR Gui::MainWindow */
|
||||
|
||||
MainWindow::MainWindow(QWidget * parent, Qt::WFlags f)
|
||||
MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f)
|
||||
: QMainWindow( parent, f/*WDestructiveClose*/ )
|
||||
{
|
||||
d = new MainWindowP;
|
||||
@@ -285,19 +285,19 @@ MainWindow::MainWindow(QWidget * parent, Qt::WFlags f)
|
||||
|
||||
// clears the action label
|
||||
d->actionTimer = new QTimer( this );
|
||||
d->actionTimer->setObjectName(QString::fromAscii("actionTimer"));
|
||||
d->actionTimer->setObjectName(QString::fromLatin1("actionTimer"));
|
||||
connect(d->actionTimer, SIGNAL(timeout()), d->actionLabel, SLOT(clear()));
|
||||
|
||||
// update gui timer
|
||||
d->activityTimer = new QTimer(this);
|
||||
d->activityTimer->setObjectName(QString::fromAscii("activityTimer"));
|
||||
d->activityTimer->setObjectName(QString::fromLatin1("activityTimer"));
|
||||
connect(d->activityTimer, SIGNAL(timeout()),this, SLOT(updateActions()));
|
||||
d->activityTimer->setSingleShot(true);
|
||||
d->activityTimer->start(300);
|
||||
|
||||
// show main window timer
|
||||
d->visibleTimer = new QTimer(this);
|
||||
d->visibleTimer->setObjectName(QString::fromAscii("visibleTimer"));
|
||||
d->visibleTimer->setObjectName(QString::fromLatin1("visibleTimer"));
|
||||
connect(d->visibleTimer, SIGNAL(timeout()),this, SLOT(showMainWindow()));
|
||||
d->visibleTimer->setSingleShot(true);
|
||||
|
||||
@@ -329,27 +329,27 @@ MainWindow::MainWindow(QWidget * parent, Qt::WFlags f)
|
||||
// Tree view
|
||||
TreeDockWidget* tree = new TreeDockWidget(0, this);
|
||||
tree->setObjectName
|
||||
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Tree view")));
|
||||
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Tree view")));
|
||||
tree->setMinimumWidth(210);
|
||||
pDockMgr->registerDockWindow("Std_TreeView", tree);
|
||||
|
||||
// Property view
|
||||
PropertyDockView* pcPropView = new PropertyDockView(0, this);
|
||||
pcPropView->setObjectName
|
||||
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Property view")));
|
||||
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Property view")));
|
||||
pcPropView->setMinimumWidth(210);
|
||||
pDockMgr->registerDockWindow("Std_PropertyView", pcPropView);
|
||||
|
||||
// Selection view
|
||||
SelectionView* pcSelectionView = new SelectionView(0, this);
|
||||
pcSelectionView->setObjectName
|
||||
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Selection view")));
|
||||
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Selection view")));
|
||||
pcSelectionView->setMinimumWidth(210);
|
||||
pDockMgr->registerDockWindow("Std_SelectionView", pcSelectionView);
|
||||
|
||||
// Combo view
|
||||
CombiView* pcCombiView = new CombiView(0, this);
|
||||
pcCombiView->setObjectName(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Combo View")));
|
||||
pcCombiView->setObjectName(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Combo View")));
|
||||
pcCombiView->setMinimumWidth(150);
|
||||
pDockMgr->registerDockWindow("Std_CombiView", pcCombiView);
|
||||
|
||||
@@ -357,14 +357,14 @@ MainWindow::MainWindow(QWidget * parent, Qt::WFlags f)
|
||||
// Report view
|
||||
Gui::DockWnd::ReportView* pcReport = new Gui::DockWnd::ReportView(this);
|
||||
pcReport->setObjectName
|
||||
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Report view")));
|
||||
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Report view")));
|
||||
pDockMgr->registerDockWindow("Std_ReportView", pcReport);
|
||||
#else
|
||||
// Report view (must be created before PythonConsole!)
|
||||
ReportOutput* pcReport = new ReportOutput(this);
|
||||
pcReport->setWindowIcon(BitmapFactory().pixmap("MacroEditor"));
|
||||
pcReport->setObjectName
|
||||
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Report view")));
|
||||
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Report view")));
|
||||
pDockMgr->registerDockWindow("Std_ReportView", pcReport);
|
||||
|
||||
// Python console
|
||||
@@ -372,7 +372,7 @@ MainWindow::MainWindow(QWidget * parent, Qt::WFlags f)
|
||||
pcPython->setWordWrapMode(QTextOption::NoWrap);
|
||||
pcPython->setWindowIcon(Gui::BitmapFactory().iconFromTheme("applications-python"));
|
||||
pcPython->setObjectName
|
||||
(QString::fromAscii(QT_TRANSLATE_NOOP("QDockWidget","Python console")));
|
||||
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Python console")));
|
||||
pDockMgr->registerDockWindow("Std_PythonView", pcPython);
|
||||
|
||||
#if 0 //defined(Q_OS_WIN32) this portion of code is not able to run with a vanilla Qtlib build on Windows.
|
||||
@@ -848,16 +848,16 @@ void MainWindow::onWindowsMenuAboutToShow()
|
||||
QAction* action = actions.at(index);
|
||||
QString text;
|
||||
QString title = child->windowTitle();
|
||||
int lastIndex = title.lastIndexOf(QString::fromAscii("[*]"));
|
||||
int lastIndex = title.lastIndexOf(QString::fromLatin1("[*]"));
|
||||
if (lastIndex > 0) {
|
||||
title = title.left(lastIndex);
|
||||
if (child->isWindowModified())
|
||||
title = QString::fromAscii("%1*").arg(title);
|
||||
title = QString::fromLatin1("%1*").arg(title);
|
||||
}
|
||||
if (index < 9)
|
||||
text = QString::fromAscii("&%1 %2").arg(index+1).arg(title);
|
||||
text = QString::fromLatin1("&%1 %2").arg(index+1).arg(title);
|
||||
else
|
||||
text = QString::fromAscii("%1 %2").arg(index+1).arg(title);
|
||||
text = QString::fromLatin1("%1 %2").arg(index+1).arg(title);
|
||||
action->setText(text);
|
||||
action->setVisible(true);
|
||||
action->setChecked(child == active);
|
||||
@@ -1047,7 +1047,7 @@ void MainWindow::delayedStartup()
|
||||
void MainWindow::appendRecentFile(const QString& filename)
|
||||
{
|
||||
RecentFilesAction *recent = this->findChild<RecentFilesAction *>
|
||||
(QString::fromAscii("recentFiles"));
|
||||
(QString::fromLatin1("recentFiles"));
|
||||
if (recent) {
|
||||
recent->appendFile(filename);
|
||||
}
|
||||
@@ -1093,18 +1093,18 @@ void MainWindow::switchToDockedMode()
|
||||
|
||||
void MainWindow::loadWindowSettings()
|
||||
{
|
||||
QString vendor = QString::fromAscii(App::Application::Config()["ExeVendor"].c_str());
|
||||
QString application = QString::fromAscii(App::Application::Config()["ExeName"].c_str());
|
||||
QString version = QString::fromAscii(App::Application::Config()["ExeVersion"].c_str());
|
||||
QString vendor = QString::fromLatin1(App::Application::Config()["ExeVendor"].c_str());
|
||||
QString application = QString::fromLatin1(App::Application::Config()["ExeName"].c_str());
|
||||
QString version = QString::fromLatin1(App::Application::Config()["ExeVersion"].c_str());
|
||||
int major = (QT_VERSION >> 0x10) & 0xff;
|
||||
int minor = (QT_VERSION >> 0x08) & 0xff;
|
||||
QString qtver = QString::fromAscii("Qt%1.%2").arg(major).arg(minor);
|
||||
QString qtver = QString::fromLatin1("Qt%1.%2").arg(major).arg(minor);
|
||||
QSettings config(vendor, application);
|
||||
|
||||
config.beginGroup(version);
|
||||
config.beginGroup(qtver);
|
||||
this->resize(config.value(QString::fromAscii("Size"), this->size()).toSize());
|
||||
QPoint pos = config.value(QString::fromAscii("Position"), this->pos()).toPoint();
|
||||
this->resize(config.value(QString::fromLatin1("Size"), this->size()).toSize());
|
||||
QPoint pos = config.value(QString::fromLatin1("Position"), this->pos()).toPoint();
|
||||
QRect rect = QApplication::desktop()->availableGeometry();
|
||||
int x1,x2,y1,y2;
|
||||
// make sure that the main window is not totally out of the visible rectangle
|
||||
@@ -1115,14 +1115,14 @@ void MainWindow::loadWindowSettings()
|
||||
|
||||
// tmp. disable the report window to suppress some bothering warnings
|
||||
Base::Console().SetEnabledMsgType("ReportOutput", ConsoleMsgType::MsgType_Wrn, false);
|
||||
this->restoreState(config.value(QString::fromAscii("MainWindowState")).toByteArray());
|
||||
this->restoreState(config.value(QString::fromLatin1("MainWindowState")).toByteArray());
|
||||
std::clog << "Main window restored" << std::endl;
|
||||
Base::Console().SetEnabledMsgType("ReportOutput", ConsoleMsgType::MsgType_Wrn, true);
|
||||
|
||||
bool max = config.value(QString::fromAscii("Maximized"), false).toBool();
|
||||
bool max = config.value(QString::fromLatin1("Maximized"), false).toBool();
|
||||
max ? showMaximized() : show();
|
||||
|
||||
statusBar()->setVisible(config.value(QString::fromAscii("StatusBar"), true).toBool());
|
||||
statusBar()->setVisible(config.value(QString::fromLatin1("StatusBar"), true).toBool());
|
||||
config.endGroup();
|
||||
config.endGroup();
|
||||
|
||||
@@ -1132,21 +1132,21 @@ void MainWindow::loadWindowSettings()
|
||||
|
||||
void MainWindow::saveWindowSettings()
|
||||
{
|
||||
QString vendor = QString::fromAscii(App::Application::Config()["ExeVendor"].c_str());
|
||||
QString application = QString::fromAscii(App::Application::Config()["ExeName"].c_str());
|
||||
QString version = QString::fromAscii(App::Application::Config()["ExeVersion"].c_str());
|
||||
QString vendor = QString::fromLatin1(App::Application::Config()["ExeVendor"].c_str());
|
||||
QString application = QString::fromLatin1(App::Application::Config()["ExeName"].c_str());
|
||||
QString version = QString::fromLatin1(App::Application::Config()["ExeVersion"].c_str());
|
||||
int major = (QT_VERSION >> 0x10) & 0xff;
|
||||
int minor = (QT_VERSION >> 0x08) & 0xff;
|
||||
QString qtver = QString::fromAscii("Qt%1.%2").arg(major).arg(minor);
|
||||
QString qtver = QString::fromLatin1("Qt%1.%2").arg(major).arg(minor);
|
||||
QSettings config(vendor, application);
|
||||
|
||||
config.beginGroup(version);
|
||||
config.beginGroup(qtver);
|
||||
config.setValue(QString::fromAscii("Size"), this->size());
|
||||
config.setValue(QString::fromAscii("Position"), this->pos());
|
||||
config.setValue(QString::fromAscii("Maximized"), this->isMaximized());
|
||||
config.setValue(QString::fromAscii("MainWindowState"), this->saveState());
|
||||
config.setValue(QString::fromAscii("StatusBar"), this->statusBar()->isVisible());
|
||||
config.setValue(QString::fromLatin1("Size"), this->size());
|
||||
config.setValue(QString::fromLatin1("Position"), this->pos());
|
||||
config.setValue(QString::fromLatin1("Maximized"), this->isMaximized());
|
||||
config.setValue(QString::fromLatin1("MainWindowState"), this->saveState());
|
||||
config.setValue(QString::fromLatin1("StatusBar"), this->statusBar()->isVisible());
|
||||
config.endGroup();
|
||||
config.endGroup();
|
||||
|
||||
@@ -1186,7 +1186,7 @@ QPixmap MainWindow::splashImage() const
|
||||
// search in the UserAppData dir as very first
|
||||
QPixmap splash_image;
|
||||
QDir dir(QString::fromUtf8(App::Application::Config()["UserAppData"].c_str()));
|
||||
QFileInfo fi(dir.filePath(QString::fromAscii("pixmaps/splash_image.png")));
|
||||
QFileInfo fi(dir.filePath(QString::fromLatin1("pixmaps/splash_image.png")));
|
||||
if (fi.isFile() && fi.exists())
|
||||
splash_image.load(fi.filePath(), "PNG");
|
||||
|
||||
@@ -1211,9 +1211,9 @@ QPixmap MainWindow::splashImage() const
|
||||
std::map<std::string,std::string>::const_iterator tc = App::Application::Config().find("SplashInfoColor");
|
||||
if (tc != App::Application::Config().end()) {
|
||||
QString title = qApp->applicationName();
|
||||
QString major = QString::fromAscii(App::Application::Config()["BuildVersionMajor"].c_str());
|
||||
QString minor = QString::fromAscii(App::Application::Config()["BuildVersionMinor"].c_str());
|
||||
QString version = QString::fromAscii("%1.%2").arg(major).arg(minor);
|
||||
QString major = QString::fromLatin1(App::Application::Config()["BuildVersionMajor"].c_str());
|
||||
QString minor = QString::fromLatin1(App::Application::Config()["BuildVersionMinor"].c_str());
|
||||
QString version = QString::fromLatin1("%1.%2").arg(major).arg(minor);
|
||||
|
||||
QPainter painter;
|
||||
painter.begin(&splash_image);
|
||||
@@ -1230,7 +1230,7 @@ QPixmap MainWindow::splashImage() const
|
||||
int v = metricVer.width(version);
|
||||
|
||||
QColor color;
|
||||
color.setNamedColor(QString::fromAscii(tc->second.c_str()));
|
||||
color.setNamedColor(QString::fromLatin1(tc->second.c_str()));
|
||||
if (color.isValid()) {
|
||||
painter.setPen(color);
|
||||
painter.setFont(fontExe);
|
||||
@@ -1444,10 +1444,10 @@ void MainWindow::loadUrls(App::Document* doc, const QList<QUrl>& url)
|
||||
if (info.isSymLink())
|
||||
info.setFile(info.readLink());
|
||||
std::vector<std::string> module = App::GetApplication()
|
||||
.getImportModules(info.completeSuffix().toAscii());
|
||||
.getImportModules(info.completeSuffix().toLatin1());
|
||||
if (module.empty()) {
|
||||
module = App::GetApplication()
|
||||
.getImportModules(info.suffix().toAscii());
|
||||
.getImportModules(info.suffix().toLatin1());
|
||||
}
|
||||
if (!module.empty()) {
|
||||
// ok, we support files with this extension
|
||||
@@ -1483,7 +1483,7 @@ void MainWindow::loadUrls(App::Document* doc, const QList<QUrl>& url)
|
||||
// load the files with the associated modules
|
||||
for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) {
|
||||
// if the passed document name doesn't exist the module should create it, if needed
|
||||
Application::Instance->importFrom(it.key().toUtf8(), docName, it.value().toAscii());
|
||||
Application::Instance->importFrom(it.key().toUtf8(), docName, it.value().toLatin1());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1576,7 +1576,7 @@ void MainWindow::customEvent(QEvent* e)
|
||||
if (d) {
|
||||
ViewProviderExtern *view = new ViewProviderExtern();
|
||||
try {
|
||||
view->setModeByString("1",msg.toAscii().constData());
|
||||
view->setModeByString("1",msg.toLatin1().constData());
|
||||
d->setAnnotationViewProvider("Vdbg",view);
|
||||
}
|
||||
catch (...) {
|
||||
@@ -1611,9 +1611,9 @@ void MainWindow::customEvent(QEvent* e)
|
||||
StatusBarObserver::StatusBarObserver()
|
||||
: WindowParameter("OutputWindow")
|
||||
{
|
||||
msg = QString::fromAscii("#000000"); // black
|
||||
wrn = QString::fromAscii("#ffaa00"); // orange
|
||||
err = QString::fromAscii("#ff0000"); // red
|
||||
msg = QString::fromLatin1("#000000"); // black
|
||||
wrn = QString::fromLatin1("#ffaa00"); // orange
|
||||
err = QString::fromLatin1("#ff0000"); // red
|
||||
Base::Console().AttachObserver(this);
|
||||
getWindowParameter()->Attach(this);
|
||||
getWindowParameter()->NotifyAll();
|
||||
@@ -1648,7 +1648,7 @@ void StatusBarObserver::OnChange(Base::Subject<const char*> &rCaller, const char
|
||||
void StatusBarObserver::Message(const char * m)
|
||||
{
|
||||
// Send the event to the main window to allow thread-safety. Qt will delete it when done.
|
||||
QString txt = QString::fromAscii("<font color=\"%1\">%2</font>").arg(this->msg).arg(QString::fromUtf8(m));
|
||||
QString txt = QString::fromLatin1("<font color=\"%1\">%2</font>").arg(this->msg).arg(QString::fromUtf8(m));
|
||||
CustomMessageEvent* ev = new CustomMessageEvent(CustomMessageEvent::Msg, txt);
|
||||
QApplication::postEvent(getMainWindow(), ev);
|
||||
}
|
||||
@@ -1659,7 +1659,7 @@ void StatusBarObserver::Message(const char * m)
|
||||
void StatusBarObserver::Warning(const char *m)
|
||||
{
|
||||
// Send the event to the main window to allow thread-safety. Qt will delete it when done.
|
||||
QString txt = QString::fromAscii("<font color=\"%1\">%2</font>").arg(this->wrn).arg(QString::fromUtf8(m));
|
||||
QString txt = QString::fromLatin1("<font color=\"%1\">%2</font>").arg(this->wrn).arg(QString::fromUtf8(m));
|
||||
CustomMessageEvent* ev = new CustomMessageEvent(CustomMessageEvent::Wrn, txt);
|
||||
QApplication::postEvent(getMainWindow(), ev);
|
||||
}
|
||||
@@ -1670,7 +1670,7 @@ void StatusBarObserver::Warning(const char *m)
|
||||
void StatusBarObserver::Error (const char *m)
|
||||
{
|
||||
// Send the event to the main window to allow thread-safety. Qt will delete it when done.
|
||||
QString txt = QString::fromAscii("<font color=\"%1\">%2</font>").arg(this->err).arg(QString::fromUtf8(m));
|
||||
QString txt = QString::fromLatin1("<font color=\"%1\">%2</font>").arg(this->err).arg(QString::fromUtf8(m));
|
||||
CustomMessageEvent* ev = new CustomMessageEvent(CustomMessageEvent::Err, txt);
|
||||
QApplication::postEvent(getMainWindow(), ev);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
* Constructs an empty main window. For default \a parent is 0, as there usually is
|
||||
* no toplevel window there.
|
||||
*/
|
||||
MainWindow(QWidget * parent = 0, Qt::WFlags f = Qt::Window);
|
||||
MainWindow(QWidget * parent = 0, Qt::WindowFlags f = Qt::Window);
|
||||
/** Destroys the object and frees any allocated resources. */
|
||||
~MainWindow();
|
||||
/**
|
||||
|
||||
@@ -332,7 +332,7 @@ class AlignmentView : public Gui::AbstractSplitView
|
||||
public:
|
||||
QLabel* myLabel;
|
||||
|
||||
AlignmentView(Gui::Document* pcDocument, QWidget* parent, QGLWidget* shareWidget=0, Qt::WFlags wflags=0)
|
||||
AlignmentView(Gui::Document* pcDocument, QWidget* parent, QGLWidget* shareWidget=0, Qt::WindowFlags wflags=0)
|
||||
: AbstractSplitView(pcDocument, parent, wflags)
|
||||
{
|
||||
QSplitter* mainSplitter=0;
|
||||
@@ -489,7 +489,7 @@ public:
|
||||
rot_cam1 = rot;
|
||||
|
||||
// copy the values
|
||||
cam2->enableNotify(FALSE);
|
||||
cam2->enableNotify(false);
|
||||
cam2->nearDistance = cam1->nearDistance;
|
||||
cam2->farDistance = cam1->farDistance;
|
||||
cam2->focalDistance = cam1->focalDistance;
|
||||
@@ -512,7 +512,7 @@ public:
|
||||
static_cast<SoOrthographicCamera*>(cam1)->height;
|
||||
}
|
||||
|
||||
cam2->enableNotify(TRUE);
|
||||
cam2->enableNotify(true);
|
||||
}
|
||||
static
|
||||
void syncCameraCB(void * data, SoSensor * s)
|
||||
|
||||
@@ -202,7 +202,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||
const int button = event->getButton();
|
||||
const SbBool press //the button was pressed (if false -> released)
|
||||
= event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
= event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
switch (button) {
|
||||
case SoMouseButtonEvent::BUTTON1:
|
||||
this->button1down = press;
|
||||
@@ -278,7 +278,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
|
||||
//----------all this were preparations. Now comes the event handling! ----------
|
||||
|
||||
SbBool processed = FALSE;//a return value for the BlahblahblahNavigationStyle::processSoEvent
|
||||
SbBool processed = false;//a return value for the BlahblahblahNavigationStyle::processSoEvent
|
||||
bool propagated = false;//an internal flag indicating that the event has been already passed to inherited, to suppress the automatic doing of this at the end.
|
||||
//goto finalize = return processed. Might be important to do something before done (none now).
|
||||
|
||||
@@ -292,10 +292,10 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
// Mode-independent keyboard handling
|
||||
if (evIsKeyboard) {
|
||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
switch (event->getKey()) {
|
||||
case SoKeyboardEvent::H:
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
if(!press){
|
||||
SbBool ret = NavigationStyle::lookAtPoint(event->getPosition());
|
||||
if(!ret){
|
||||
@@ -316,7 +316,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||
if (event)
|
||||
this->processMotionEvent(event);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
if (processed)
|
||||
goto finalize;
|
||||
@@ -331,7 +331,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
//keyboard
|
||||
if (evIsKeyboard) {
|
||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
|
||||
switch(event->getKey()){
|
||||
case SoKeyboardEvent::S:
|
||||
@@ -345,15 +345,15 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
break;
|
||||
case SoKeyboardEvent::PAGE_UP:
|
||||
if(press){
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||
}
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
break;
|
||||
case SoKeyboardEvent::PAGE_DOWN:
|
||||
if(press){
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||
}
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -368,7 +368,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||
const int button = event->getButton();
|
||||
const SbBool press //the button was pressed (if false -> released)
|
||||
= event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
= event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
switch(button){
|
||||
case SoMouseButtonEvent::BUTTON1:
|
||||
case SoMouseButtonEvent::BUTTON2:
|
||||
@@ -420,15 +420,15 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
"No object under cursor! Can't set new center of rotation.\n");
|
||||
}
|
||||
}
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON4: //(wheel?)
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), TRUE, posn);
|
||||
processed = TRUE;
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
|
||||
processed = true;
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON5: //(wheel?)
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), FALSE, posn);
|
||||
processed = TRUE;
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
|
||||
processed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -516,23 +516,23 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (evIsLoc2 && ! this->inGesture && this->mouseMoveThresholdBroken) {
|
||||
if (curmode == NavigationStyle::ZOOMING) {//doesn't happen
|
||||
this->zoomByCursor(posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
} else if (curmode == NavigationStyle::PANNING) {
|
||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
} else if (curmode == NavigationStyle::DRAGGING) {
|
||||
if (comboAfter & BUTTON1DOWN && comboAfter & BUTTON2DOWN) {
|
||||
//two mouse buttons down - tilting!
|
||||
NavigationStyle::doRotate(viewer->getSoRenderManager()->getCamera(),
|
||||
(posn - prevnormalized)[0]*(-2),
|
||||
SbVec2f(0.5,0.5));
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
} else {//one mouse button - normal spinning
|
||||
//this will also handle the single-finger drag (there's no gesture used, pseudomouse is enough)
|
||||
//this->addToLog(event->getPosition(), event->getTime());
|
||||
this->spin_simplified(viewer->getSoRenderManager()->getCamera(),
|
||||
posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -578,7 +578,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (evIsButton) {
|
||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||
const int button = event->getButton();
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
if (button == SoMouseButtonEvent::BUTTON1 && press) {
|
||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||
this->setViewingMode(NavigationStyle::SEEK_MODE);
|
||||
|
||||
@@ -198,7 +198,7 @@ void MenuManager::setup(MenuItem* menuItems) const
|
||||
for (QList<MenuItem*>::ConstIterator it = items.begin(); it != items.end(); ++it)
|
||||
{
|
||||
// search for the menu action
|
||||
QAction* action = findAction(actions, QString::fromAscii((*it)->command().c_str()));
|
||||
QAction* action = findAction(actions, QString::fromLatin1((*it)->command().c_str()));
|
||||
if (!action) {
|
||||
// There must be not more than one separator in the menu bar, so
|
||||
// we can safely remove it if available and append it at the end
|
||||
@@ -213,12 +213,12 @@ void MenuManager::setup(MenuItem* menuItems) const
|
||||
QApplication::translate("Workbench", menuName.c_str(),
|
||||
0, QApplication::UnicodeUTF8));
|
||||
action = menu->menuAction();
|
||||
menu->setObjectName(QString::fromAscii(menuName.c_str()));
|
||||
action->setObjectName(QString::fromAscii(menuName.c_str()));
|
||||
menu->setObjectName(QString::fromLatin1(menuName.c_str()));
|
||||
action->setObjectName(QString::fromLatin1(menuName.c_str()));
|
||||
}
|
||||
|
||||
// set the menu user data
|
||||
action->setData(QString::fromAscii((*it)->command().c_str()));
|
||||
action->setData(QString::fromLatin1((*it)->command().c_str()));
|
||||
}
|
||||
else {
|
||||
// put the menu at the end
|
||||
@@ -250,7 +250,7 @@ void MenuManager::setup(MenuItem* item, QMenu* menu) const
|
||||
QList<QAction*> actions = menu->actions();
|
||||
for (QList<MenuItem*>::ConstIterator it = items.begin(); it != items.end(); ++it) {
|
||||
// search for the menu item
|
||||
QList<QAction*> used_actions = findActions(actions, QString::fromAscii((*it)->command().c_str()));
|
||||
QList<QAction*> used_actions = findActions(actions, QString::fromLatin1((*it)->command().c_str()));
|
||||
if (used_actions.isEmpty()) {
|
||||
if ((*it)->command() == "Separator") {
|
||||
QAction* action = menu->addSeparator();
|
||||
@@ -267,10 +267,10 @@ void MenuManager::setup(MenuItem* item, QMenu* menu) const
|
||||
QApplication::translate("Workbench", menuName.c_str(),
|
||||
0, QApplication::UnicodeUTF8));
|
||||
QAction* action = submenu->menuAction();
|
||||
submenu->setObjectName(QString::fromAscii((*it)->command().c_str()));
|
||||
action->setObjectName(QString::fromAscii((*it)->command().c_str()));
|
||||
submenu->setObjectName(QString::fromLatin1((*it)->command().c_str()));
|
||||
action->setObjectName(QString::fromLatin1((*it)->command().c_str()));
|
||||
// set the menu user data
|
||||
action->setData(QString::fromAscii((*it)->command().c_str()));
|
||||
action->setData(QString::fromLatin1((*it)->command().c_str()));
|
||||
used_actions.append(action);
|
||||
}
|
||||
else {
|
||||
@@ -282,7 +282,7 @@ void MenuManager::setup(MenuItem* item, QMenu* menu) const
|
||||
for (int i=count; i < acts.count(); i++) {
|
||||
QAction* a = acts[i];
|
||||
// set the menu user data
|
||||
a->setData(QString::fromAscii((*it)->command().c_str()));
|
||||
a->setData(QString::fromLatin1((*it)->command().c_str()));
|
||||
used_actions.append(a);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ int AbstractMouseSelection::handleEvent(const SoEvent* const ev, const SbViewpor
|
||||
|
||||
if (ev->getTypeId().isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||
const SoMouseButtonEvent* const event = (const SoMouseButtonEvent*) ev;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
|
||||
if (press) {
|
||||
_clPoly.push_back(ev->getPosition());
|
||||
@@ -311,7 +311,7 @@ int PolyPickerSelection::popupMenu()
|
||||
int PolyPickerSelection::mouseButtonEvent(const SoMouseButtonEvent* const e, const QPoint& pos)
|
||||
{
|
||||
const int button = e->getButton();
|
||||
const SbBool press = e->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = e->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
|
||||
if (press) {
|
||||
switch(button)
|
||||
@@ -501,7 +501,7 @@ int BrushSelection::popupMenu()
|
||||
int BrushSelection::mouseButtonEvent(const SoMouseButtonEvent* const e, const QPoint& pos)
|
||||
{
|
||||
const int button = e->getButton();
|
||||
const SbBool press = e->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = e->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
|
||||
if (press) {
|
||||
switch(button)
|
||||
@@ -658,7 +658,7 @@ void RubberbandSelection::draw()
|
||||
int RubberbandSelection::mouseButtonEvent(const SoMouseButtonEvent* const e, const QPoint& pos)
|
||||
{
|
||||
const int button = e->getButton();
|
||||
const SbBool press = e->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = e->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
|
||||
int ret = Continue;
|
||||
|
||||
|
||||
+32
-32
@@ -64,9 +64,9 @@ struct NavigationStyleP {
|
||||
{
|
||||
this->animationsteps = 0;
|
||||
this->sensitivity = 2.0f;
|
||||
this->resetcursorpos = FALSE;
|
||||
this->dragPointFound = FALSE;
|
||||
this->dragAtCursor = FALSE;
|
||||
this->resetcursorpos = false;
|
||||
this->dragPointFound = false;
|
||||
this->dragAtCursor = false;
|
||||
}
|
||||
static void viewAnimationCB(void * data, SoSensor * sensor);
|
||||
};
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
Trackball
|
||||
};
|
||||
|
||||
FCSphereSheetProjector(const SbSphere & sph, const SbBool orienttoeye = TRUE)
|
||||
FCSphereSheetProjector(const SbSphere & sph, const SbBool orienttoeye = true)
|
||||
: SbSphereSheetProjector(sph, orienttoeye), orbit(Trackball)
|
||||
{
|
||||
}
|
||||
@@ -205,7 +205,7 @@ void NavigationStyle::initialize()
|
||||
{
|
||||
this->currentmode = NavigationStyle::IDLE;
|
||||
this->prevRedrawTime = SbTime::getTimeOfDay();
|
||||
this->spinanimatingallowed = TRUE;
|
||||
this->spinanimatingallowed = true;
|
||||
this->spinsamplecounter = 0;
|
||||
this->spinincrement = SbRotation::identity();
|
||||
this->spinRotation.setValue(SbVec3f(0, 0, -1), 0);
|
||||
@@ -223,13 +223,13 @@ void NavigationStyle::initialize()
|
||||
this->log.time = new SbTime [ 16 ];
|
||||
this->log.historysize = 0;
|
||||
|
||||
this->menuenabled = TRUE;
|
||||
this->button1down = FALSE;
|
||||
this->button2down = FALSE;
|
||||
this->button3down = FALSE;
|
||||
this->ctrldown = FALSE;
|
||||
this->shiftdown = FALSE;
|
||||
this->altdown = FALSE;
|
||||
this->menuenabled = true;
|
||||
this->button1down = false;
|
||||
this->button2down = false;
|
||||
this->button3down = false;
|
||||
this->ctrldown = false;
|
||||
this->shiftdown = false;
|
||||
this->altdown = false;
|
||||
this->invertZoom = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/View")->GetBool("InvertZoom",true);
|
||||
this->zoomAtCursor = App::GetApplication().GetParameterGroupByPath
|
||||
@@ -305,7 +305,7 @@ void NavigationStyle::seekToPoint(const SbVec3f& scenepos)
|
||||
SbBool NavigationStyle::lookAtPoint(const SbVec2s screenpos)
|
||||
{
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (cam == 0) return FALSE;
|
||||
if (cam == 0) return false;
|
||||
|
||||
SoRayPickAction rpaction(viewer->getSoRenderManager()->getViewportRegion());
|
||||
rpaction.setPoint(screenpos);
|
||||
@@ -315,20 +315,20 @@ SbBool NavigationStyle::lookAtPoint(const SbVec2s screenpos)
|
||||
SoPickedPoint * picked = rpaction.getPickedPoint();
|
||||
if (!picked) {
|
||||
this->interactiveCountInc();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
SbVec3f hitpoint;
|
||||
hitpoint = picked->getPoint();
|
||||
lookAtPoint(hitpoint);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void NavigationStyle::lookAtPoint(const SbVec3f& pos)
|
||||
{
|
||||
SoCamera* cam = viewer->getSoRenderManager()->getCamera();
|
||||
if (cam == 0) return;
|
||||
PRIVATE(this)->dragPointFound = FALSE;
|
||||
PRIVATE(this)->dragPointFound = false;
|
||||
|
||||
// Find global coordinates of focal point.
|
||||
SbVec3f direction;
|
||||
@@ -661,7 +661,7 @@ void NavigationStyle::panToCenter(const SbPlane & pplane, const SbVec2f & currpo
|
||||
const SbViewportRegion & vp = viewer->getSoRenderManager()->getViewportRegion();
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, pplane, SbVec2f(0.5,0.5), currpos);
|
||||
PRIVATE(this)->dragPointFound = FALSE;
|
||||
PRIVATE(this)->dragPointFound = false;
|
||||
}
|
||||
|
||||
/** Dependent on the camera type this will either shrink or expand the
|
||||
@@ -693,12 +693,12 @@ void NavigationStyle::zoom(SoCamera * cam, float diffvalue)
|
||||
// frustum (similar to glFrustum())
|
||||
if (!t.isDerivedFrom(SoPerspectiveCamera::getClassTypeId()) &&
|
||||
tname != "FrustumCamera") {
|
||||
/* static SbBool first = TRUE;
|
||||
/* static SbBool first = true;
|
||||
if (first) {
|
||||
SoDebugError::postWarning("SoGuiFullViewerP::zoom",
|
||||
"Unknown camera type, "
|
||||
"will zoom by moving position, but this might not be correct.");
|
||||
first = FALSE;
|
||||
first = false;
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -975,12 +975,12 @@ SbBool NavigationStyle::doSpin()
|
||||
rot.getValue(axis, radians);
|
||||
if ((radians > 0.01f) && (deltatime < 0.300)) {
|
||||
this->spinRotation = rot;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void NavigationStyle::saveCursorPosition(const SoEvent * const ev)
|
||||
@@ -997,7 +997,7 @@ void NavigationStyle::saveCursorPosition(const SoEvent * const ev)
|
||||
|
||||
SoPickedPoint * picked = rpaction.getPickedPoint();
|
||||
if (picked) {
|
||||
PRIVATE(this)->dragPointFound = TRUE;
|
||||
PRIVATE(this)->dragPointFound = true;
|
||||
PRIVATE(this)->startDragPoint = picked->getPoint();
|
||||
}
|
||||
}
|
||||
@@ -1064,7 +1064,7 @@ SbBool NavigationStyle::handleEventInForeground(const SoEvent* const e)
|
||||
Decide if it should be possible to start a spin animation of the
|
||||
model in the viewer by releasing the mouse button while dragging.
|
||||
|
||||
If the \a enable flag is \c FALSE and we're currently animating, the
|
||||
If the \a enable flag is \c false and we're currently animating, the
|
||||
spin will be stopped.
|
||||
*/
|
||||
void
|
||||
@@ -1219,7 +1219,7 @@ void NavigationStyle::stopSelection()
|
||||
|
||||
SbBool NavigationStyle::isSelecting() const
|
||||
{
|
||||
return (mouseSelection ? TRUE : FALSE);
|
||||
return (mouseSelection ? true : false);
|
||||
}
|
||||
|
||||
const std::vector<SbVec2s>& NavigationStyle::getPolygon(SbBool* clip_inner) const
|
||||
@@ -1332,7 +1332,7 @@ SbBool NavigationStyle::processEvent(const SoEvent * const ev)
|
||||
int hd=mouseSelection->handleEvent(ev,viewer->getSoRenderManager()->getViewportRegion());
|
||||
if (hd==AbstractMouseSelection::Continue||
|
||||
hd==AbstractMouseSelection::Restart) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else if (hd==AbstractMouseSelection::Finish) {
|
||||
pcPolygon = mouseSelection->getPositions();
|
||||
@@ -1353,7 +1353,7 @@ SbBool NavigationStyle::processEvent(const SoEvent * const ev)
|
||||
|
||||
const ViewerMode curmode = this->currentmode;
|
||||
|
||||
SbBool processed = FALSE;
|
||||
SbBool processed = false;
|
||||
processed = this->processSoEvent(ev);
|
||||
|
||||
// check for left click without selecting something
|
||||
@@ -1399,7 +1399,7 @@ void NavigationStyle::syncWithEvent(const SoEvent * const ev)
|
||||
// Keyboard handling
|
||||
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
switch (event->getKey()) {
|
||||
case SoKeyboardEvent::LEFT_CONTROL:
|
||||
case SoKeyboardEvent::RIGHT_CONTROL:
|
||||
@@ -1422,7 +1422,7 @@ void NavigationStyle::syncWithEvent(const SoEvent * const ev)
|
||||
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||
const int button = event->getButton();
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
|
||||
// SoDebugError::postInfo("processSoEvent", "button = %d", button);
|
||||
switch (button) {
|
||||
@@ -1445,7 +1445,7 @@ SbBool NavigationStyle::processMotionEvent(const SoMotion3Event * const ev)
|
||||
{
|
||||
SoCamera * const camera = viewer->getSoRenderManager()->getCamera();
|
||||
if (!camera)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
SbViewVolume volume(camera->getViewVolume());
|
||||
SbVec3f center(volume.getSightPoint(camera->focalDistance.getValue()));
|
||||
@@ -1469,7 +1469,7 @@ SbBool NavigationStyle::processMotionEvent(const SoMotion3Event * const ev)
|
||||
camera->orientation.getValue().multVec(dir,dir);
|
||||
camera->position = newPosition + (dir * translationFactor);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void NavigationStyle::setPopupMenuEnabled(const SbBool on)
|
||||
@@ -1498,12 +1498,12 @@ void NavigationStyle::openPopupMenu(const SbVec2s& position)
|
||||
contextMenu.addMenu(&subMenu);
|
||||
|
||||
// add submenu at the end to select navigation style
|
||||
QRegExp rx(QString::fromAscii("^\\w+::(\\w+)Navigation\\w+$"));
|
||||
QRegExp rx(QString::fromLatin1("^\\w+::(\\w+)Navigation\\w+$"));
|
||||
std::vector<Base::Type> types;
|
||||
Base::Type::getAllDerivedFrom(UserNavigationStyle::getClassTypeId(), types);
|
||||
for (std::vector<Base::Type>::iterator it = types.begin(); it != types.end(); ++it) {
|
||||
if (*it != UserNavigationStyle::getClassTypeId()) {
|
||||
QString data = QString::fromAscii(it->getName());
|
||||
QString data = QString::fromLatin1(it->getName());
|
||||
QString name = data.mid(data.indexOf(QLatin1String("::"))+2);
|
||||
if (rx.indexIn(data) > -1) {
|
||||
name = QObject::tr("%1 navigation").arg(rx.cap(1));
|
||||
|
||||
@@ -118,7 +118,7 @@ void NetworkRetriever::testFailure()
|
||||
if ( wget->state() == QProcess::Running )
|
||||
{
|
||||
d->fail = false;
|
||||
Base::Console().Message( tr("Download started...\n").toAscii() );
|
||||
Base::Console().Message( tr("Download started...\n").toLatin1() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,15 +240,15 @@ bool NetworkRetriever::startDownload( const QString& startUrl )
|
||||
if ( !d->proxy.isEmpty() )
|
||||
{
|
||||
QStringList env = wget->environment();
|
||||
env << QString::fromAscii("http_proxy=%1").arg(d->proxy);
|
||||
env << QString::fromAscii("ftp_proxy=%1").arg(d->proxy);
|
||||
env << QString::fromLatin1("http_proxy=%1").arg(d->proxy);
|
||||
env << QString::fromLatin1("ftp_proxy=%1").arg(d->proxy);
|
||||
wget->setEnvironment(env);
|
||||
}
|
||||
else
|
||||
{
|
||||
QStringList env = wget->environment();
|
||||
env.removeAll(QString::fromAscii("http_proxy=%1").arg(d->proxy));
|
||||
env.removeAll(QString::fromAscii("ftp_proxy=%1").arg(d->proxy));
|
||||
env.removeAll(QString::fromLatin1("http_proxy=%1").arg(d->proxy));
|
||||
env.removeAll(QString::fromLatin1("ftp_proxy=%1").arg(d->proxy));
|
||||
wget->setEnvironment(env);
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ bool NetworkRetriever::startDownload( const QString& startUrl )
|
||||
{
|
||||
if ( dir.mkdir( d->dir ) == false)
|
||||
{
|
||||
Base::Console().Error("Directory '%s' could not be created.", (const char*)d->dir.toAscii());
|
||||
Base::Console().Error("Directory '%s' could not be created.", (const char*)d->dir.toLatin1());
|
||||
return true; // please, no error message
|
||||
}
|
||||
}
|
||||
@@ -277,43 +277,43 @@ bool NetworkRetriever::startDownload( const QString& startUrl )
|
||||
{
|
||||
if ( !d->user.isEmpty() )
|
||||
{
|
||||
wgetArguments << QString::fromAscii("--proxy-user=%1").arg( d->user );
|
||||
wgetArguments << QString::fromLatin1("--proxy-user=%1").arg( d->user );
|
||||
if ( !d->passwd.isEmpty() )
|
||||
{
|
||||
wgetArguments << QString::fromAscii("--proxy-passwd=%1").arg( d->passwd );
|
||||
wgetArguments << QString::fromLatin1("--proxy-passwd=%1").arg( d->passwd );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// output file
|
||||
if ( !d->outputFile.isEmpty() )
|
||||
wgetArguments << QString::fromAscii("--output-document=%1").arg( d->outputFile );
|
||||
wgetArguments << QString::fromLatin1("--output-document=%1").arg( d->outputFile );
|
||||
// timestamping enabled -> update newer files only
|
||||
if ( d->timeStamp )
|
||||
wgetArguments << QString::fromAscii("-N");
|
||||
wgetArguments << QString::fromLatin1("-N");
|
||||
// get all needed image files
|
||||
if ( d->img )
|
||||
wgetArguments << QString::fromAscii("-p");
|
||||
wgetArguments << QString::fromLatin1("-p");
|
||||
// follow relative links only
|
||||
if ( d->folRel )
|
||||
wgetArguments<< QString::fromAscii("-L");
|
||||
wgetArguments<< QString::fromLatin1("-L");
|
||||
if ( d->recurse )
|
||||
{
|
||||
wgetArguments << QString::fromAscii("-r");
|
||||
wgetArguments << QString::fromAscii("--level=%1").arg( d->level );
|
||||
wgetArguments << QString::fromLatin1("-r");
|
||||
wgetArguments << QString::fromLatin1("--level=%1").arg( d->level );
|
||||
}
|
||||
|
||||
if ( d->nop )
|
||||
wgetArguments << QString::fromAscii("-np");
|
||||
wgetArguments << QString::fromLatin1("-np");
|
||||
|
||||
// convert absolute links in to relative
|
||||
if ( d->convert )
|
||||
wgetArguments << QString::fromAscii("-k");
|
||||
wgetArguments << QString::fromLatin1("-k");
|
||||
// number of tries
|
||||
wgetArguments << QString::fromAscii("--tries=%1").arg( d->tries );
|
||||
wgetArguments << QString::fromLatin1("--tries=%1").arg( d->tries );
|
||||
// use HTML file extension
|
||||
if ( d->html )
|
||||
wgetArguments << QString::fromAscii("-E");
|
||||
wgetArguments << QString::fromLatin1("-E");
|
||||
|
||||
// start URL
|
||||
wgetArguments << startUrl;
|
||||
@@ -326,10 +326,10 @@ bool NetworkRetriever::startDownload( const QString& startUrl )
|
||||
QDir::setCurrent(d->dir);
|
||||
}
|
||||
|
||||
wget->start(QString::fromAscii("wget"), wgetArguments);
|
||||
wget->start(QString::fromLatin1("wget"), wgetArguments);
|
||||
QDir::setCurrent( cwd );
|
||||
#else
|
||||
wget->start(QString::fromAscii("wget"), wgetArguments);
|
||||
wget->start(QString::fromLatin1("wget"), wgetArguments);
|
||||
#endif
|
||||
|
||||
return wget->state() == QProcess::Running;
|
||||
@@ -371,7 +371,7 @@ void NetworkRetriever::wgetFinished(int exitCode, QProcess::ExitStatus status)
|
||||
bool NetworkRetriever::testWget()
|
||||
{
|
||||
QProcess proc;
|
||||
proc.start(QString::fromAscii("wget"));
|
||||
proc.start(QString::fromLatin1("wget"));
|
||||
bool ok = proc.state() == QProcess::Running;
|
||||
proc.kill();
|
||||
proc.waitForFinished();
|
||||
@@ -414,7 +414,7 @@ Action * StdCmdDownloadOnlineHelp::createAction(void)
|
||||
{
|
||||
Action *pcAction;
|
||||
|
||||
QString exe = QString::fromAscii(App::GetApplication().getExecutableName());
|
||||
QString exe = QString::fromLatin1(App::GetApplication().getExecutableName());
|
||||
pcAction = new Action(this,getMainWindow());
|
||||
pcAction->setText(QCoreApplication::translate(
|
||||
this->className(), sMenuText, 0,
|
||||
@@ -429,7 +429,7 @@ Action * StdCmdDownloadOnlineHelp::createAction(void)
|
||||
this->className(), sWhatsThis, 0,
|
||||
QCoreApplication::CodecForTr).arg(exe));
|
||||
pcAction->setIcon(Gui::BitmapFactory().pixmap(sPixmap));
|
||||
pcAction->setShortcut(QString::fromAscii(sAccel));
|
||||
pcAction->setShortcut(QString::fromLatin1(sAccel));
|
||||
|
||||
return pcAction;
|
||||
}
|
||||
@@ -437,7 +437,7 @@ Action * StdCmdDownloadOnlineHelp::createAction(void)
|
||||
void StdCmdDownloadOnlineHelp::languageChange()
|
||||
{
|
||||
if (_pcAction) {
|
||||
QString exe = QString::fromAscii(App::GetApplication().getExecutableName());
|
||||
QString exe = QString::fromLatin1(App::GetApplication().getExecutableName());
|
||||
_pcAction->setText(QCoreApplication::translate(
|
||||
this->className(), sMenuText, 0,
|
||||
QCoreApplication::CodecForTr));
|
||||
@@ -479,7 +479,7 @@ void StdCmdDownloadOnlineHelp::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
wget->setProxy(QString::fromAscii(prx.c_str()), username, password);
|
||||
wget->setProxy(QString::fromLatin1(prx.c_str()), username, password);
|
||||
}
|
||||
|
||||
int loop=3;
|
||||
@@ -487,9 +487,9 @@ void StdCmdDownloadOnlineHelp::activated(int iMsg)
|
||||
|
||||
// set output directory
|
||||
QString path = QString::fromUtf8(App::GetApplication().getHomePath());
|
||||
path += QString::fromAscii("/doc/");
|
||||
path += QString::fromLatin1("/doc/");
|
||||
ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/OnlineHelp");
|
||||
path = QString::fromUtf8(hURLGrp->GetASCII( "DownloadLocation", path.toAscii() ).c_str());
|
||||
path = QString::fromUtf8(hURLGrp->GetASCII( "DownloadLocation", path.toLatin1() ).c_str());
|
||||
|
||||
while (loop > 0) {
|
||||
loop--;
|
||||
@@ -536,7 +536,7 @@ void StdCmdDownloadOnlineHelp::activated(int iMsg)
|
||||
}
|
||||
|
||||
if (canStart) {
|
||||
bool ok = wget->startDownload(QString::fromAscii(url.c_str()));
|
||||
bool ok = wget->startDownload(QString::fromLatin1(url.c_str()));
|
||||
if ( ok == false )
|
||||
Base::Console().Error("The tool 'wget' couldn't be found. Please check your installation.");
|
||||
else if ( wget->isDownloading() && _pcAction )
|
||||
|
||||
@@ -78,7 +78,7 @@ OnlineDocumentation::OnlineDocumentation()
|
||||
if (zip.isValid()) {
|
||||
zipios::ConstEntries entries = zip.entries();
|
||||
for (zipios::ConstEntries::iterator it = entries.begin(); it != entries.end(); ++it) {
|
||||
this->files.push_back(QString::fromAscii((*it)->getFileName().c_str()));
|
||||
this->files.push_back(QString::fromLatin1((*it)->getFileName().c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ QByteArray OnlineDocumentation::loadResource(const QString& filename) const
|
||||
}
|
||||
else if (filename == QLatin1String("/")) {
|
||||
// load the startpage
|
||||
QString header = QString::fromAscii(
|
||||
QString header = QString::fromLatin1(
|
||||
"<!doctype html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"
|
||||
"<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">"
|
||||
"<html><head><title>Python: Index of Modules</title>"
|
||||
@@ -128,12 +128,12 @@ QByteArray OnlineDocumentation::loadResource(const QString& filename) const
|
||||
if (file.endsWith(QLatin1String(".html"))) {
|
||||
file.chop(5);
|
||||
if ((++ct)%15 == 0)
|
||||
header += QString::fromAscii("</td><td width=\"25%\" valign=top>");
|
||||
header += QString::fromAscii("<a href=\"%1.html\">%2</a><br>").arg(file).arg(file);
|
||||
header += QString::fromLatin1("</td><td width=\"25%\" valign=top>");
|
||||
header += QString::fromLatin1("<a href=\"%1.html\">%2</a><br>").arg(file).arg(file);
|
||||
}
|
||||
}
|
||||
|
||||
header += QString::fromAscii(
|
||||
header += QString::fromLatin1(
|
||||
"</td></tr></table></td></tr></table> <p>"
|
||||
//"<p align=right>"
|
||||
//"<font color=\"#909090\" face=\"helvetica, arial\"><strong>"
|
||||
@@ -146,7 +146,7 @@ QByteArray OnlineDocumentation::loadResource(const QString& filename) const
|
||||
std::string path = App::GetApplication().getHomePath();
|
||||
path += "/doc/docs.zip";
|
||||
zipios::ZipFile zip(path);
|
||||
zipios::ConstEntryPointer entry = zip.getEntry((const char*)fn.toAscii());
|
||||
zipios::ConstEntryPointer entry = zip.getEntry((const char*)fn.toLatin1());
|
||||
std::istream* str = zip.getInputStream(entry);
|
||||
|
||||
// set size of the array so that no re-allocation is needed when reading from the stream
|
||||
@@ -158,8 +158,8 @@ QByteArray OnlineDocumentation::loadResource(const QString& filename) const
|
||||
}
|
||||
else {
|
||||
// load the error page
|
||||
QHttpResponseHeader header(404, QString::fromAscii("File not found"));
|
||||
header.setContentType(QString::fromAscii("text/html\r\n"
|
||||
QHttpResponseHeader header(404, QString::fromLatin1("File not found"));
|
||||
header.setContentType(QString::fromLatin1("text/html\r\n"
|
||||
"\r\n"
|
||||
"<html><head><title>Error</title></head>"
|
||||
"<body bgcolor=\"#f0f0f8\">"
|
||||
@@ -318,8 +318,8 @@ QByteArray PythonOnlineHelp::loadResource(const QString& filename) const
|
||||
QByteArray PythonOnlineHelp::fileNotFound() const
|
||||
{
|
||||
QByteArray res;
|
||||
QHttpResponseHeader header(404, QString::fromAscii("File not found"));
|
||||
header.setContentType(QString::fromAscii("text/html\r\n"
|
||||
QHttpResponseHeader header(404, QString::fromLatin1("File not found"));
|
||||
header.setContentType(QString::fromLatin1("text/html\r\n"
|
||||
"\r\n"
|
||||
"<html><head><title>Error</title></head>"
|
||||
"<body bgcolor=\"#f0f0f8\">"
|
||||
@@ -380,7 +380,7 @@ void HttpServer::readClient()
|
||||
// corresponding HTML document from the ZIP file.
|
||||
QTcpSocket* socket = (QTcpSocket*)sender();
|
||||
if (socket->canReadLine()) {
|
||||
QString request = QString::fromAscii(socket->readLine());
|
||||
QString request = QString::fromLatin1(socket->readLine());
|
||||
QHttpRequestHeader header(request);
|
||||
if (header.method() == QLatin1String("GET")) {
|
||||
socket->write(help.loadResource(header.path()));
|
||||
|
||||
@@ -98,11 +98,11 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
|
||||
this->lastmouseposition = posn;
|
||||
|
||||
// Set to TRUE if any event processing happened. Note that it is not
|
||||
// Set to true if any event processing happened. Note that it is not
|
||||
// necessary to restrict ourselves to only do one "action" for an
|
||||
// event, we only need this flag to see if any processing happened
|
||||
// at all.
|
||||
SbBool processed = FALSE;
|
||||
SbBool processed = false;
|
||||
|
||||
const ViewerMode curmode = this->currentmode;
|
||||
ViewerMode newmode = curmode;
|
||||
@@ -123,13 +123,13 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (!processed && !viewer->isEditing()) {
|
||||
processed = handleEventInForeground(ev);
|
||||
if (processed)
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Keyboard handling
|
||||
if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
|
||||
const SoKeyboardEvent * const event = (const SoKeyboardEvent *) ev;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
switch (event->getKey()) {
|
||||
case SoKeyboardEvent::LEFT_CONTROL:
|
||||
case SoKeyboardEvent::RIGHT_CONTROL:
|
||||
@@ -144,7 +144,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
this->altdown = press;
|
||||
break;
|
||||
case SoKeyboardEvent::H:
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
viewer->saveHomePosition();
|
||||
break;
|
||||
case SoKeyboardEvent::S:
|
||||
@@ -165,33 +165,33 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
|
||||
const SoMouseButtonEvent * const event = (const SoMouseButtonEvent *) ev;
|
||||
const int button = event->getButton();
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? TRUE : FALSE;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false;
|
||||
|
||||
switch (button) {
|
||||
case SoMouseButtonEvent::BUTTON1:
|
||||
this->lockrecenter = TRUE;
|
||||
this->lockrecenter = true;
|
||||
this->button1down = press;
|
||||
if (press && (this->currentmode == NavigationStyle::SEEK_WAIT_MODE)) {
|
||||
newmode = NavigationStyle::SEEK_MODE;
|
||||
this->seekToPoint(pos); // implicitly calls interactiveCountInc()
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (!press && (this->currentmode == NavigationStyle::ZOOMING)) {
|
||||
newmode = NavigationStyle::IDLE;
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
||||
this->setViewing(false);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON2:
|
||||
// If we are in edit mode then simply ignore the RMB events
|
||||
// to pass the event to the base class.
|
||||
this->lockrecenter = TRUE;
|
||||
this->lockrecenter = true;
|
||||
if (!viewer->isEditing()) {
|
||||
// If we are in zoom or pan mode ignore RMB events otherwise
|
||||
// the canvas doesn't get any release events
|
||||
@@ -211,11 +211,11 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
newmode = NavigationStyle::DRAGGING;
|
||||
saveCursorPosition(ev);
|
||||
this->centerTime = ev->getTime();
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
|
||||
newmode = NavigationStyle::IDLE;
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
this->button2down = press;
|
||||
break;
|
||||
@@ -225,18 +225,18 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
||||
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
||||
this->lockrecenter = FALSE;
|
||||
this->lockrecenter = false;
|
||||
}
|
||||
else if (!press && (this->currentmode == NavigationStyle::PANNING)) {
|
||||
newmode = NavigationStyle::IDLE;
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
this->button3down = press;
|
||||
break;
|
||||
case SoMouseButtonEvent::BUTTON4:
|
||||
case SoMouseButtonEvent::BUTTON5:
|
||||
doZoom(viewer->getSoRenderManager()->getCamera(), button == SoMouseButtonEvent::BUTTON4, posn);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -259,7 +259,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
|
||||
// Mouse Movement handling
|
||||
if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) {
|
||||
this->lockrecenter = TRUE;
|
||||
this->lockrecenter = true;
|
||||
const SoLocation2Event * const event = (const SoLocation2Event *) ev;
|
||||
if (this->currentmode == NavigationStyle::ZOOMING) {
|
||||
// OCCT uses horizontal mouse position, not vertical
|
||||
@@ -268,18 +268,18 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (this->invertZoom)
|
||||
value = -value;
|
||||
zoom(viewer->getSoRenderManager()->getCamera(), value);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (this->currentmode == NavigationStyle::PANNING) {
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (this->currentmode == NavigationStyle::DRAGGING) {
|
||||
this->addToLog(event->getPosition(), event->getTime());
|
||||
this->spin(posn);
|
||||
moveCursorPosition();
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
else if (combo == (CTRLDOWN|BUTTON1DOWN)) {
|
||||
newmode = NavigationStyle::ZOOMING;
|
||||
@@ -291,7 +291,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
|
||||
if (event)
|
||||
this->processMotionEvent(event);
|
||||
processed = TRUE;
|
||||
processed = true;
|
||||
}
|
||||
|
||||
switch (combo) {
|
||||
@@ -327,7 +327,7 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (/*(curmode == NavigationStyle::SELECTION || viewer->isEditing()) && */!processed)
|
||||
processed = inherited::processSoEvent(ev);
|
||||
else
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return processed;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
|
||||
/* TRANSLATOR Gui::Dialog::Placement */
|
||||
|
||||
Placement::Placement(QWidget* parent, Qt::WFlags fl)
|
||||
Placement::Placement(QWidget* parent, Qt::WindowFlags fl)
|
||||
: Gui::LocationDialog(parent, fl)
|
||||
{
|
||||
propertyName = "Placement"; // default name
|
||||
@@ -217,20 +217,20 @@ void Placement::applyPlacement(const QString& data, bool incremental)
|
||||
if (jt != props.end()) {
|
||||
QString cmd;
|
||||
if (incremental)
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.getDocument(\"%1\").%2.Placement=%3.multiply(App.getDocument(\"%1\").%2.Placement)")
|
||||
.arg(QLatin1String((*it)->getDocument()->getName()))
|
||||
.arg(QLatin1String((*it)->getNameInDocument()))
|
||||
.arg(data);
|
||||
else {
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.getDocument(\"%1\").%2.Placement=%3")
|
||||
.arg(QLatin1String((*it)->getDocument()->getName()))
|
||||
.arg(QLatin1String((*it)->getNameInDocument()))
|
||||
.arg(data);
|
||||
}
|
||||
|
||||
Application::Instance->runPythonCode((const char*)cmd.toAscii());
|
||||
Application::Instance->runPythonCode((const char*)cmd.toLatin1());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ void Placement::setPlacementData(const Base::Placement& p)
|
||||
|
||||
if (newitem) {
|
||||
// add a new item before the very last item
|
||||
QString display = QString::fromAscii("(%1,%2,%3)")
|
||||
QString display = QString::fromLatin1("(%1,%2,%3)")
|
||||
.arg(dir.x)
|
||||
.arg(dir.y)
|
||||
.arg(dir.z);
|
||||
@@ -448,7 +448,7 @@ QString Placement::getPlacementString() const
|
||||
|
||||
if (index == 0) {
|
||||
Base::Vector3d dir = getDirection();
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.Placement(App.Vector(%1,%2,%3), App.Rotation(App.Vector(%4,%5,%6),%7), App.Vector(%8,%9,%10))")
|
||||
.arg(ui->xPos->value().getValue())
|
||||
.arg(ui->yPos->value().getValue())
|
||||
@@ -462,7 +462,7 @@ QString Placement::getPlacementString() const
|
||||
.arg(ui->zCnt->value().getValue());
|
||||
}
|
||||
else if (index == 1) {
|
||||
cmd = QString::fromAscii(
|
||||
cmd = QString::fromLatin1(
|
||||
"App.Placement(App.Vector(%1,%2,%3), App.Rotation(%4,%5,%6), App.Vector(%7,%8,%9))")
|
||||
.arg(ui->xPos->value().getValue())
|
||||
.arg(ui->yPos->value().getValue())
|
||||
@@ -492,7 +492,7 @@ void Placement::changeEvent(QEvent *e)
|
||||
|
||||
/* TRANSLATOR Gui::Dialog::DockablePlacement */
|
||||
|
||||
DockablePlacement::DockablePlacement(QWidget* parent, Qt::WFlags fl) : Placement(parent, fl)
|
||||
DockablePlacement::DockablePlacement(QWidget* parent, Qt::WindowFlags fl) : Placement(parent, fl)
|
||||
{
|
||||
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
|
||||
QDockWidget* dw = pDockMgr->addDockWindow(QT_TR_NOOP("Placement"),
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ class GuiExport Placement : public Gui::LocationDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Placement(QWidget* parent = 0, Qt::WFlags fl = 0);
|
||||
Placement(QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
~Placement();
|
||||
void accept();
|
||||
void reject();
|
||||
@@ -98,7 +98,7 @@ class GuiExport DockablePlacement : public Placement
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DockablePlacement(QWidget* parent = 0, Qt::WFlags fl = 0);
|
||||
DockablePlacement(QWidget* parent = 0, Qt::WindowFlags fl = 0);
|
||||
~DockablePlacement();
|
||||
|
||||
void accept();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user