git-svn-id: svn://db.shs.com.ru/libs@357 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2018-02-13 13:59:11 +00:00
parent a9a05517a9
commit 540b358a08
26 changed files with 218 additions and 260 deletions

View File

@@ -1,6 +1,6 @@
project(cd_pult)
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
find_qt(${QtVersions} Core Gui)
find_qt(${QtVersions} Core Gui OpenGL)
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
qt_add_executable(${PROJECT_NAME} WIN32 out_CPP)
qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets qad_graphic qcd_utils qad_application)

View File

@@ -24,10 +24,10 @@ CDPultWindow::CDPultWindow(QWidget *parent) : EMainWindow(parent), ui(new Ui::CD
session.addEntry(ribbon->tabWidget());
session.load();
reset();
CONNECTU(&K, sended, this, KSended);
CONNECTU(&K, received, this, KReceived);
CONNECTU(&K, sendFailed, this, KSendFailed);
CONNECTU(&K, receiveFailed, this, KReceiveFailed);
connect(ui->viewK, SIGNAL(KSendSucceed()), this, SLOT(KSended()));
connect(ui->viewK, SIGNAL(KReceiveSucceed()), this, SLOT(KReceived()));
connect(ui->viewK, SIGNAL(KSendFailed()), this, SLOT(KSendFailed()));
connect(ui->viewK, SIGNAL(KReceiveFailed()), this, SLOT(KReceiveFailed()));
if (windowState() == Qt::WindowMinimized)
setWindowState(Qt::WindowNoState);
}
@@ -44,23 +44,22 @@ void CDPultWindow::loadFile(const QString & fp) {
void CDPultWindow::KReceived() {
QMetaObject::invokeMethod(this, "addToLog", Qt::QueuedConnection, Q_ARG(LogIcon, OKIcon), Q_ARG(QString, "K received succesfull"));
addToLog(OKIcon, "K received succesfull");
}
void CDPultWindow::KSended() {
QMetaObject::invokeMethod(this, "addToLog", Qt::QueuedConnection, Q_ARG(LogIcon, OKIcon), Q_ARG(QString, "K sended succesfull"));
addToLog(OKIcon, "K sended succesfull");
}
void CDPultWindow::KSendFailed() {
QMetaObject::invokeMethod(this, "addToLog", Qt::QueuedConnection, Q_ARG(LogIcon, FailIcon), Q_ARG(QString, "K NOT sended"));
addToLog(FailIcon, "K NOT sended");
}
void CDPultWindow::KReceiveFailed() {
QMetaObject::invokeMethod(this, "addToLog", Qt::QueuedConnection, Q_ARG(LogIcon, FailIcon), Q_ARG(QString, "K NOT received"));
//addToLog(FailIcon, "K NOT received");
addToLog(FailIcon, "K NOT received");
}
@@ -77,7 +76,7 @@ void CDPultWindow::closeEvent(QCloseEvent *e) {
void CDPultWindow::reset(bool full) {
setWindowTitle(QString("CD Pult"));
ui->viewK->setKFile("");
ui->viewK->clearK();
// ui->viewK->clearK();
file_name.clear();
ui->viewK->refresh();
setChanged(false);

View File

@@ -10,11 +10,10 @@ namespace Ui {
class CDPultWindow;
}
class CDPultWindow : public EMainWindow, public PIObject
class CDPultWindow : public EMainWindow
{
Q_OBJECT
Q_ENUMS(LogIcon)
PIOBJECT(CDPultWindow)
public:
enum LogIcon {NoIcon, OKIcon, FailIcon, WaitIcon};
@@ -24,12 +23,7 @@ public:
private:
EVENT_HANDLER(void, KSended);
EVENT_HANDLER(void, KReceived);
EVENT_HANDLER(void, KSendFailed);
EVENT_HANDLER(void, KReceiveFailed);
void closeEvent(QCloseEvent * );
void closeEvent(QCloseEvent *);
void reset(bool full = false);
bool load(const QString & path);
bool save(const QString & path);
@@ -41,6 +35,10 @@ private:
QMap<LogIcon, QIcon> log_icons;
private slots:
void KSended();
void KReceived();
void KSendFailed();
void KReceiveFailed();
void addToLog(LogIcon icon, const QString & msg);
void on_actionSend_K_triggered();
void on_actionReceive_K_triggered();