mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 00:53:53 +02:00
2018-11-08 Fred Gleason <fredg@paravelsystems.com>
* Restored the status display bubble on rdmonitor(1).
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
## Makefile.am
|
||||
##
|
||||
## (C) Copyright 2012,2016-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
## (C) Copyright 2012-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License version 2 as
|
||||
|
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qdir.h>
|
||||
#include <qfontmetrics.h>
|
||||
#include <qlabel.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qpainter.h>
|
||||
@@ -60,7 +61,8 @@ void SigHandler(int signo)
|
||||
}
|
||||
|
||||
MainWidget::MainWidget(QWidget *parent)
|
||||
:QWidget(parent,"",Qt::WStyle_Customize|Qt::WStyle_NoBorder|Qt::WStyle_StaysOnTop|Qt::WX11BypassWM)
|
||||
: QWidget(parent,(Qt::WindowFlags)(Qt::WStyle_Customize|Qt::WStyle_NoBorder|Qt::WStyle_StaysOnTop))
|
||||
// : QWidget(parent,"",(Qt::WindowFlags)(Qt::WStyle_Customize|Qt::WStyle_NoBorder|Qt::WStyle_StaysOnTop|Qt::WX11BypassWM|Qt::WA_AlwaysShowToolTips))
|
||||
{
|
||||
QString str;
|
||||
mon_dialog_x=0;
|
||||
@@ -122,6 +124,13 @@ MainWidget::MainWidget(QWidget *parent)
|
||||
mon_red_label->setPixmap(QPixmap(redball_xpm));
|
||||
mon_red_label->hide();
|
||||
|
||||
//
|
||||
// Status Label
|
||||
//
|
||||
mon_status_label=new QLabel(NULL,(Qt::WindowFlags)(Qt::WStyle_Customize|Qt::WStyle_NoBorder|Qt::WStyle_StaysOnTop));
|
||||
mon_status_label->setAlignment(Qt::AlignCenter|Qt::AlignVCenter);
|
||||
mon_status_label->hide();
|
||||
|
||||
//
|
||||
// Validation Timer
|
||||
//
|
||||
@@ -171,6 +180,7 @@ void MainWidget::validate()
|
||||
//
|
||||
// Record Results
|
||||
//
|
||||
SetToolTip(db_ok,schema,snd_ok);
|
||||
// mon_tooltip->
|
||||
// setStatus(QRect(0,0,size().width(),size().height()),db_ok,schema,snd_ok);
|
||||
SetSummaryState(db_ok&&(schema==RD_VERSION_DATABASE)&&snd_ok);
|
||||
@@ -184,6 +194,20 @@ void MainWidget::quitMainWidget()
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::enterEvent(QEvent *e)
|
||||
{
|
||||
mon_status_label->show();
|
||||
QWidget::enterEvent(e);
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::leaveEvent(QEvent *e)
|
||||
{
|
||||
mon_status_label->hide();
|
||||
QWidget::leaveEvent(e);
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
if(e->button()!=Qt::RightButton) {
|
||||
@@ -383,6 +407,69 @@ void MainWidget::SetPosition()
|
||||
break;
|
||||
}
|
||||
setGeometry(x,y,width,RDMONITOR_HEIGHT);
|
||||
SetStatusPosition();
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::SetToolTip(bool db_status,int schema,bool snd_status)
|
||||
{
|
||||
mon_status_label->clear();
|
||||
if(db_status&&(schema==RD_VERSION_DATABASE)&&snd_status) {
|
||||
mon_status_label->setText(tr("Status: OK"));
|
||||
}
|
||||
else {
|
||||
if(!db_status) {
|
||||
mon_status_label->setText(tr("Database: CONNECTION FAILED"));
|
||||
}
|
||||
else {
|
||||
if(schema!=RD_VERSION_DATABASE) {
|
||||
mon_status_label->setText(tr("Database: SCHEMA SKEWED"));
|
||||
}
|
||||
}
|
||||
if(!snd_status) {
|
||||
if(!mon_status_label->text().isEmpty()) {
|
||||
mon_status_label->setText(mon_status_label->text()+"\n");
|
||||
}
|
||||
mon_status_label->
|
||||
setText(mon_status_label->text()+tr("Audio Store: FAILED"));
|
||||
}
|
||||
}
|
||||
SetStatusPosition();
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::SetStatusPosition()
|
||||
{
|
||||
QFontMetrics *fm=new QFontMetrics(mon_status_label->font());
|
||||
int h=10+fm->height();
|
||||
int w=10+fm->width(mon_status_label->text());
|
||||
|
||||
switch(mon_config->position()) {
|
||||
case RDMonitorConfig::UpperLeft:
|
||||
case RDMonitorConfig::UpperCenter:
|
||||
mon_status_label->setGeometry(geometry().x(),geometry().y()+(2+geometry().height()),w,h);
|
||||
break;
|
||||
|
||||
case RDMonitorConfig::UpperRight:
|
||||
mon_status_label->setGeometry(geometry().x()-h,geometry().y()+(2+geometry().height()),w,h);
|
||||
break;
|
||||
|
||||
case RDMonitorConfig::LowerLeft:
|
||||
case RDMonitorConfig::LowerCenter:
|
||||
mon_status_label->setGeometry(geometry().x(),geometry().y()-(2+h),w,h);
|
||||
break;
|
||||
|
||||
break;
|
||||
|
||||
case RDMonitorConfig::LowerRight:
|
||||
mon_status_label->setGeometry(geometry().x()-h,geometry().y()-(2+h),w,h);
|
||||
break;
|
||||
|
||||
case RDMonitorConfig::LastPosition:
|
||||
break;
|
||||
}
|
||||
|
||||
delete fm;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -31,9 +31,6 @@
|
||||
#include <qtimer.h>
|
||||
#include <qdesktopwidget.h>
|
||||
#include <qfontmetrics.h>
|
||||
//Added by qt3to4:
|
||||
#include <QPaintEvent>
|
||||
#include <QResizeEvent>
|
||||
#include <QMouseEvent>
|
||||
|
||||
#include <rdconfig.h>
|
||||
@@ -57,6 +54,8 @@ class MainWidget : public QWidget
|
||||
void quitMainWidget();
|
||||
|
||||
protected:
|
||||
void enterEvent(QEvent *e);
|
||||
void leaveEvent(QEvent *e);
|
||||
void mousePressEvent(QMouseEvent *e);
|
||||
void mouseDoubleClickEvent(QMouseEvent *e);
|
||||
void paintEvent(QPaintEvent *e);
|
||||
@@ -65,6 +64,8 @@ class MainWidget : public QWidget
|
||||
private:
|
||||
void SetSummaryState(bool state);
|
||||
void SetPosition();
|
||||
void SetToolTip(bool db_status,int schema,bool snd_status);
|
||||
void SetStatusPosition();
|
||||
QLabel *mon_name_label;
|
||||
QLabel *mon_green_label;
|
||||
QLabel *mon_red_label;
|
||||
@@ -75,6 +76,7 @@ class MainWidget : public QWidget
|
||||
int mon_dialog_y;
|
||||
int mon_rdselect_x;
|
||||
int mon_rdselect_y;
|
||||
QLabel *mon_status_label;
|
||||
// StatusTip *mon_tooltip;
|
||||
QDesktopWidget *mon_desktop_widget;
|
||||
RDMonitorConfig *mon_config;
|
||||
|
@@ -15,6 +15,22 @@
|
||||
<source>RDSelect returned non-zero exit code</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Status: OK</source>
|
||||
<translation type="unfinished">Stav: OK</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: CONNECTION FAILED</source>
|
||||
<translation type="unfinished">Databáze: SPOJENÍ SE NEZDAŘILO</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: SCHEMA SKEWED</source>
|
||||
<translation type="unfinished">Databáze: SCHÉMA ZKRESLENO</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Audio Store: FAILED</source>
|
||||
<translation type="unfinished">Uložení zvuku: NEPODAŘILO SE</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
@@ -15,6 +15,22 @@
|
||||
<source>RDSelect returned non-zero exit code</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Status: OK</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: CONNECTION FAILED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: SCHEMA SKEWED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Audio Store: FAILED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
@@ -15,6 +15,22 @@
|
||||
<source>RDSelect returned non-zero exit code</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Status: OK</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: CONNECTION FAILED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: SCHEMA SKEWED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Audio Store: FAILED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
@@ -15,6 +15,22 @@
|
||||
<source>RDSelect returned non-zero exit code</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Status: OK</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: CONNECTION FAILED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: SCHEMA SKEWED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Audio Store: FAILED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
@@ -15,6 +15,22 @@
|
||||
<source>RDSelect returned non-zero exit code</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Status: OK</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: CONNECTION FAILED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: SCHEMA SKEWED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Audio Store: FAILED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
@@ -15,6 +15,22 @@
|
||||
<source>RDSelect returned non-zero exit code</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Status: OK</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: CONNECTION FAILED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: SCHEMA SKEWED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Audio Store: FAILED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
@@ -15,6 +15,22 @@
|
||||
<source>RDSelect returned non-zero exit code</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Status: OK</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: CONNECTION FAILED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database: SCHEMA SKEWED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Audio Store: FAILED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
Reference in New Issue
Block a user