From: Hamatoma Date: Wed, 5 Oct 2016 19:16:11 +0000 (+0200) Subject: recommand: adaptions to changed base classes X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=217af3dc70381ecbf14d48179a8f432960cd4f71;p=reqt recommand: adaptions to changed base classes --- diff --git a/appl/recommand/main.cpp b/appl/recommand/main.cpp index 1b5145e..35b3e89 100644 --- a/appl/recommand/main.cpp +++ b/appl/recommand/main.cpp @@ -16,7 +16,7 @@ int main(int argc, char *argv[]){ g_argv = argv; QString homeDir = argc > 1 ? argv[1] : ""; QApplication a(argc, argv); - MainWindow w(homeDir); + MainWindow w(a, homeDir); w.show(); return a.exec(); } diff --git a/appl/recommand/mainwindow.cpp b/appl/recommand/mainwindow.cpp index ec4b6e2..07c7df0 100644 --- a/appl/recommand/mainwindow.cpp +++ b/appl/recommand/mainwindow.cpp @@ -11,17 +11,21 @@ #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); @@ -36,6 +40,8 @@ MainWindow::MainWindow(const QString& homeDir, QWidget *parent) : connect(ui->listWidgetHistory, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(onHistoryDoubleClicked(QListWidgetItem*))); onLoad(); + say(LOG_INFO, tr("Version:") + " " + VERSION); + } /** * Destructor. @@ -107,8 +113,8 @@ void MainWindow::onGuiTimerUpdate() 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; diff --git a/appl/recommand/mainwindow.hpp b/appl/recommand/mainwindow.hpp index 60e8884..e329107 100644 --- a/appl/recommand/mainwindow.hpp +++ b/appl/recommand/mainwindow.hpp @@ -25,7 +25,7 @@ class MainWindow : public ReGuiApplication, public ReGuiValidator { 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: @@ -43,10 +43,11 @@ protected: 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 diff --git a/appl/reimgconvert/mainwindow.cpp b/appl/reimgconvert/mainwindow.cpp index 40409cc..38910c3 100644 --- a/appl/reimgconvert/mainwindow.cpp +++ b/appl/reimgconvert/mainwindow.cpp @@ -29,6 +29,8 @@ const QString VERSION("2016.10.04"); /** * @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) :