27 #include "ui_InternalSettingsDialogForm.h" 30 #include "../widgets/log/LogTextEdit.h" 31 #include "../../core/plugin/PluginManager.h" 32 #include "../../core/filesystem/FileSystem.h" 33 #include "../../common/PlatformUtils.h" 34 #include "../../common/TerraLib.h" 37 #include <QDesktopWidget> 39 #if (QT_VERSION >= 0x050000) 40 #include <QStandardPaths> 42 #include <QDesktopServices> 45 #include <boost/filesystem.hpp> 50 m_ui(new
Ui::InternalSettingsDialogForm)
70 setWindowModality(Qt::NonModal);
72 setAttribute(Qt::WA_DeleteOnClose);
79 m_ui->m_tabWidget->addTab(widget, tabName);
87 #if (QT_VERSION >= 0x050000) 88 userDataDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
90 userDataDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
93 m_ui->m_userPathLineEdit->setText(userDataDir);
95 m_ui->m_gdalDirLineEdit->setText(TERRALIB_GDAL_DATA);
99 m_ui->m_curPathLineEdit->setText(curPath.string().c_str());
102 m_ui->m_previousCurPathLineEdit->setText(curPath.string().c_str());
104 std::string terraDir;
105 const char* teHomeEnv = getenv(TERRALIB_DIR_VAR_NAME);
106 if (teHomeEnv !=
nullptr)
107 terraDir = getenv(TERRALIB_DIR_VAR_NAME);
108 m_ui->m_terraLibHomeLineEdit->setText(terraDir.c_str());
110 m_ui->m_installPrefixLineEdit->setText(TERRALIB_INSTALL_PREFIX_PATH);
112 m_ui->m_codebasePathLineEdit->setText(TERRALIB_CODEBASE_PATH);
117 m_ui->m_modulesListWidget->clear();
121 for (std::size_t t = 0; t < nModules; ++t)
125 m_ui->m_modulesListWidget->addItem(name.c_str());
131 m_ui->m_pluginsListWidget->clear();
135 for (std::size_t t = 0; t < plugins.size(); ++t)
137 std::string name = plugins[t];
139 m_ui->m_pluginsListWidget->addItem(name.c_str());
145 m_ui->m_dpiXLineEdit->setText(QString::number(qApp->desktop()->logicalDpiX()));
147 m_ui->m_dpiYLineEdit->setText(QString::number(qApp->desktop()->logicalDpiY()));
163 m_ui->m_logNextPushButton->setIcon(QIcon::fromTheme(
"go-down"));
164 m_ui->m_logPreviousPushButton->setIcon(QIcon::fromTheme(
"go-up"));
165 m_ui->m_logClearPushButton->setIcon(QIcon::fromTheme(
"edit-clear"));
167 connect(
m_ui->m_logNextPushButton, SIGNAL(clicked(
bool)),
this,
170 connect(
m_ui->m_logPreviousPushButton, SIGNAL(clicked(
bool)),
this,
173 connect(
m_ui->m_logClearPushButton, SIGNAL(clicked(
bool)),
174 m_ui->m_logTextEdit, SLOT(clear()));
176 connect(
m_ui->m_logFindLineEdit, SIGNAL(textChanged(
const QString&)),
177 m_ui->m_logTextEdit, SLOT(findAll(
const QString&)));
182 m_ui->m_logTextEdit->find(
m_ui->m_logFindLineEdit->text());
188 m_ui->m_logTextEdit->find(
m_ui->m_logFindLineEdit->text(),
189 QTextDocument::FindBackward);
InternalSettingsDialog(QWidget *parent=0, Qt::WindowFlags f=0)
TECOMMONEXPORT unsigned long long int GetTotalVirtualMemory()
Returns the amount of total virtual memory (bytes) that can be claimed by the current process (physic...
virtual ~InternalSettingsDialog()
const std::string & getModuleName(std::size_t i) const
It return the i-th module name.
A Dialog to be used to inform about internal settings.
TECOMMONEXPORT unsigned int GetPhysProcNumber()
Returns the number of physical processors.
std::vector< std::string > getPlugins() const
Return the list of plugins managed by PluginManager.
static PluginManager & instance()
Access the singleton.
std::size_t getNumRegModules() const
It returns the number of registered modules.
static TerraLib & getInstance()
It returns a reference to the singleton instance.
void onFindPreviousClicked()
void addTab(QWidget *widget, QString tabName)
TECOMMONEXPORT unsigned long long int GetTotalPhysicalMemory()
Returns the amount of total physical memory (bytes).
Ui::InternalSettingsDialogForm * m_ui
static std::string currentPath()
Retrives the current working directory path in UTF-8.
TECOMMONEXPORT unsigned long long int GetFreePhysicalMemory()
Returns the amount of free physical memory (bytes).
TECOMMONEXPORT unsigned long long int GetUsedVirtualMemory()
Returns the amount of used virtual memory (bytes) for the current process (physical + swapped)...