#include "recommand.hpp"
+const QString VERSION("2016.10.05");
+
/**
* Constructor.
*
- * @param homeDir "" or the home directory
- * @param parent NULL ot the owner of the main window
+ * @param application the assigned application
+ * @param homeDir "" or the home directory
+ * @param parent NULL ot the owner of the main window
*/
-MainWindow::MainWindow(const QString& homeDir, QWidget *parent) :
- ReGuiApplication("recommand", homeDir, 2, 100100100, parent),
+MainWindow::MainWindow(QApplication& application, const QString& homeDir, QWidget *parent) :
+ ReGuiApplication(application, "recommand", homeDir, 2, 100100100, "de", parent),
ReGuiValidator(),
ui(new Ui::MainWindow),
- m_processor(NULL)
+ m_processor(NULL),
+ m_maxListSize(100)
{
m_processor = new CommandProcessor(this);
ui->setupUi(this);
connect(ui->listWidgetHistory, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
this, SLOT(onHistoryDoubleClicked(QListWidgetItem*)));
onLoad();
+ say(LOG_INFO, tr("Version:") + " " + VERSION);
+
}
/**
* Destructor.
m_mutexGuiQueue.unlock();
if (item.m_type == ReGuiQueueItem::Undef)
break;
- if (! item.apply()){
- switch (item.m_type){
+ if (! item.apply(m_guiQueue, m_maxListSize)){
+ switch (item.m_type){
case ReGuiQueueItem::ReadyMessage:
say(LOG_INFO, item.m_value);
break;
{
Q_OBJECT
public:
- explicit MainWindow(const QString& homeDir, QWidget *parent = 0);
+ explicit MainWindow(QApplication& application, const QString& homeDir, QWidget *parent = 0);
virtual ~MainWindow();
public slots:
void toHistory(const QString& text);
public:
virtual bool say(ReLoggerLevel level, const QString& message);
-
+ virtual void onLanguageChange(){}
private:
Ui::MainWindow *ui;
CommandProcessor* m_processor;
+ int m_maxListSize;
};
#endif // MAINWINDOW_HPP
/**
* @brief Constructor.
*
+ * @param application the assigned application
+ * @param homeDir "" or the home directory
* @param parent NULL or the parent (who destroys the objects at the end)
*/
MainWindow::MainWindow(QApplication& application, const QString& homeDir, QWidget *parent) :