2022-04-29 Fred Gleason <fredg@paravelsystems.com>

* Added a 'StayOnTop=' directive to the '[SoftKeys]' section of
	rd.conf(5).

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2022-04-29 10:31:53 -04:00
parent 037b8b9fe5
commit ebe1bcc3f7
4 changed files with 34 additions and 8 deletions

View File

@ -22993,3 +22993,6 @@
files. files.
2022-04-21 Fred Gleason <fredg@paravelsystems.com> 2022-04-21 Fred Gleason <fredg@paravelsystems.com>
* Removed dead code from rdadmin(1). * Removed dead code from rdadmin(1).
2022-04-29 Fred Gleason <fredg@paravelsystems.com>
* Added a 'StayOnTop=' directive to the '[SoftKeys]' section of
rd.conf(5).

View File

@ -143,6 +143,8 @@ ChannelsPerPcm=-1
; can use the --map-file=<filename> switch to configure multiple soft ; can use the --map-file=<filename> switch to configure multiple soft
; key setups on the same host. ; key setups on the same host.
; ;
; StayOnTop=No
;
; Columns=10 ; Columns=10
; ;
; Command1=hithlum.srlabs.loc:GO 3 1 1 0! ; Command1=hithlum.srlabs.loc:GO 3 1 1 0!

View File

@ -2,7 +2,7 @@
// //
// A utility for sending RML Commands // A utility for sending RML Commands
// //
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -36,15 +36,14 @@
// //
#include "../icons/rivendell-22x22.xpm" #include "../icons/rivendell-22x22.xpm"
MainWidget::MainWidget(QWidget *parent) MainWidget::MainWidget(RDConfig *config,Qt::WindowFlags f)
: QWidget(parent) : QWidget(NULL,f)
{ {
key_ysize=70; key_ysize=70;
// //
// Read Command Options // Read Command Options
// //
RDConfig *config=new RDConfig();
QString map_filename=config->filename(); QString map_filename=config->filename();
RDCmdSwitch *cmd=new RDCmdSwitch("rdsoftkeys",RDSOFTKEYS_USAGE); RDCmdSwitch *cmd=new RDCmdSwitch("rdsoftkeys",RDSOFTKEYS_USAGE);
for(unsigned i=0;i<cmd->keys();i++) { for(unsigned i=0;i<cmd->keys();i++) {
@ -233,10 +232,30 @@ int main(int argc,char *argv[])
a.installTranslator(&tests); a.installTranslator(&tests);
} }
//
// Read Command Options
//
RDConfig *config=new RDConfig();
QString map_filename=config->filename();
RDCmdSwitch *cmd=new RDCmdSwitch("rdsoftkeys",RDSOFTKEYS_USAGE);
for(unsigned i=0;i<cmd->keys();i++) {
if(cmd->key(i)=="--map-file") {
map_filename=cmd->value(i);
}
}
delete cmd;
RDProfile *profile=new RDProfile();
Qt::WindowFlags f=Qt::WindowFlags();
profile->setSource(map_filename);
if(profile->boolValue("SoftKeys","StayOnTop",false)) {
f=f|Qt::WindowStaysOnTopHint;
}
delete profile;
// //
// Start Event Loop // Start Event Loop
// //
MainWidget *w=new MainWidget(); MainWidget *w=new MainWidget(config,f);
w->setGeometry(w->geometry().x(),w->geometry().y(),w->sizeHint().width(),w->sizeHint().height()); w->setGeometry(w->geometry().x(),w->geometry().y(),w->sizeHint().width(),w->sizeHint().height());
w->show(); w->show();
return a.exec(); return a.exec();

View File

@ -2,7 +2,7 @@
// //
// A utility for sending RML Commands // A utility for sending RML Commands
// //
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -25,6 +25,8 @@
#include <QUdpSocket> #include <QUdpSocket>
#include <QWidget> #include <QWidget>
#include <rdconfig.h>
// //
// Settings // Settings
// //
@ -35,7 +37,7 @@ class MainWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
MainWidget(QWidget *parent=0); MainWidget(RDConfig *config,Qt::WindowFlags f=Qt::WindowFlags());
QSize sizeHint() const; QSize sizeHint() const;
QSizePolicy sizePolicy() const; QSizePolicy sizePolicy() const;