mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-18 22:22:36 +02:00
2021-06-19 Fred Gleason <fredg@paravelsystems.com>
* Added 'RDMainWindow' to rdcatch(1). Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
76c4c9626f
commit
5f6b72d2f4
@ -21925,3 +21925,5 @@
|
||||
* Added 'RDMainWindow' to rdpanel(1).
|
||||
2021-06-19 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added 'RDMainWindow' to rdcastmanager(1).
|
||||
2021-06-19 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added 'RDMainWindow' to rdcatch(1).
|
||||
|
@ -73,7 +73,7 @@ QString CatchConnector::stationName()
|
||||
|
||||
|
||||
MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
: RDWidget(c,parent)
|
||||
: RDMainWindow("rdcatch",c)
|
||||
{
|
||||
QString str;
|
||||
QString err_msg;
|
||||
@ -427,7 +427,8 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
catch_midnight_timer->setSingleShot(true);
|
||||
connect(catch_midnight_timer,SIGNAL(timeout()),this,SLOT(midnightData()));
|
||||
midnightData();
|
||||
LoadGeometry();
|
||||
|
||||
loadSettings(true);
|
||||
|
||||
QTime current_time=QTime::currentTime().addMSecs(catch_time_offset);
|
||||
QDate current_date=QDate::currentDate();
|
||||
@ -995,7 +996,9 @@ void MainWidget::heartbeatFailedData(int id)
|
||||
void MainWidget::quitMainWidget()
|
||||
{
|
||||
catch_db->removeDatabase(rda->config()->mysqlDbname());
|
||||
SaveGeometry();
|
||||
|
||||
saveSettings();
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@ -1324,37 +1327,6 @@ QString MainWidget::GeometryFile() {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWidget::LoadGeometry()
|
||||
{
|
||||
QString geometry_file=GeometryFile();
|
||||
if(geometry_file.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
RDProfile *profile=new RDProfile();
|
||||
profile->setSource(geometry_file);
|
||||
resize(profile->intValue("RDCatch","Width",sizeHint().width()),
|
||||
profile->intValue("RDCatch","Height",sizeHint().height()));
|
||||
|
||||
delete profile;
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::SaveGeometry()
|
||||
{
|
||||
QString geometry_file=GeometryFile();
|
||||
if(geometry_file.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
FILE *file=fopen(geometry_file.toUtf8(),"w");
|
||||
if(file==NULL) {
|
||||
return;
|
||||
}
|
||||
fprintf(file,"[RDCatch]\n");
|
||||
fprintf(file,"Width=%d\n",geometry().width());
|
||||
fprintf(file,"Height=%d\n",geometry().height());
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <QScrollArea>
|
||||
|
||||
#include <rdcatch_connect.h>
|
||||
#include <rdmainwindow.h>
|
||||
#include <rdtableview.h>
|
||||
#include <rdtransportbutton.h>
|
||||
#include <rdwidget.h>
|
||||
@ -59,7 +60,7 @@ class CatchConnector
|
||||
};
|
||||
|
||||
|
||||
class MainWidget : public RDWidget
|
||||
class MainWidget : public RDMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@ -116,8 +117,6 @@ class MainWidget : public RDWidget
|
||||
int GetMonitor(int serial,int chan);
|
||||
int GetConnection(QString station,unsigned chan=0);
|
||||
QString GeometryFile();
|
||||
void LoadGeometry();
|
||||
void SaveGeometry();
|
||||
std::vector<CatchMonitor *> catch_monitor;
|
||||
QScrollArea *catch_monitor_area;
|
||||
VBox *catch_monitor_vbox;
|
||||
|
Loading…
x
Reference in New Issue
Block a user