14 #include <QDesktopWidget> 15 #include <QApplication> 16 #include <QFileDialog> 34 CX_LOG_INFO() <<
"Log folder: " << mLog->getLoggingFolder();
38 this->updateWindowTitle();
41 this->setCentralWidget(consoles);
43 this->initializeGeometry();
46 void LogConsole::initializeGeometry()
48 if (!this->restoreGeometry(this->getGeometryOption().readVariant().toByteArray()))
49 this->setDefaultGeometry();
52 void LogConsole::setDefaultGeometry()
54 QDesktopWidget* desktop =
dynamic_cast<QApplication*
>(QApplication::instance())->desktop();
55 QRect screen = desktop->screenGeometry(desktop->primaryScreen());
56 screen.adjust(screen.width()*0.5, screen.height()*0.25, 0, 0);
57 this->setGeometry(screen);
67 this->getGeometryOption().
writeVariant(this->saveGeometry());
72 void LogConsole::createMenus()
75 QAction* selectFolderAction =
new QAction(QIcon(
":/icons/open_icon_library/document-import-2.png"), tr(
"&Select folder"),
this);
76 selectFolderAction->setShortcut(tr(
"Ctrl+L"));
77 selectFolderAction->setStatusTip(tr(
"Select folder"));
78 connect(selectFolderAction, &QAction::triggered,
this, &LogConsole::onSelectFolder);
80 QMenu* fileMenu =
new QMenu(tr(
"File"),
this);
81 fileMenu->addAction(selectFolderAction);
82 this->menuBar()->addMenu(fileMenu);
85 void LogConsole::updateWindowTitle()
87 QString title = QString(
"Log Console [%1]").arg(mLog->getLoggingFolder());
88 this->setWindowTitle(title);
91 void LogConsole::onSelectFolder()
93 QString folder = mLog->getLoggingFolder() +
"/..";
95 folder = QFileDialog::getExistingDirectory(
this,
"Open log folder", folder);
101 mLog->setLoggingFolder(folder);
102 this->updateWindowTitle();
void writeVariant(const QVariant &val)
QDomElement getElement()
return the current element
Helper class for storing one string value in an xml document.
static QString getPersistentWritablePath()
Path to location usable for persistent and temporary storage of config. Do not use directly...
void save()
save entire document.
Helper class for xml files used to store ssc/cx data.
static LogFileWatcherPtr create()
Namespace for all CustusX production code.