2018-02-01 Fred Gleason <fredg@paravelsystems.com>

* Moved command-switch processing into RDApplication.
This commit is contained in:
Fred Gleason
2018-01-31 13:25:48 -05:00
parent 2103fa72c1
commit 3d380c4de8
73 changed files with 520 additions and 240 deletions

View File

@@ -101,18 +101,10 @@ MainWidget::MainWidget(QWidget *parent)
{
QString str1;
QString str2;
log_log_list=NULL;
QString err_msg;
//
// Read Command Options
//
RDCmdSwitch *cmd=new RDCmdSwitch(qApp->argc(),qApp->argv(),"rdlogedit","\n");
for(unsigned i=0;i<cmd->keys();i++) {
if(cmd->key(i)=="--skip-db-check") {
}
}
delete cmd;
log_resize=false;
log_log_list=NULL;
//
// Fix the Window Size
@@ -127,13 +119,28 @@ MainWidget::MainWidget(QWidget *parent)
RDInitializeDaemons();
#endif // WIN32
rda=new RDApplication("RDLogEdit",this);
//
// Open the Database
//
rda=new RDApplication("RDLogEdit","rdlogedit",RDLOGEDIT_USAGE,this);
if(!rda->open(&err_msg)) {
QMessageBox::critical(this,"RDLogEdit - "+tr("Error"),err_msg);
exit(1);
}
log_import_path=RDGetHomeDir();
//
// Read Command Options
//
for(unsigned i=0;i<rda->cmdSwitch()->keys();i++) {
if(!rda->cmdSwitch()->processed(i)) {
QMessageBox::critical(this,"RDLogEdit - "+tr("Error"),
tr("Unknown command option")+": "+
rda->cmdSwitch()->key(i));
exit(2);
}
}
//
// CAE Connection
//
@@ -298,6 +305,8 @@ MainWidget::MainWidget(QWidget *parent)
setCaption(QString().sprintf("%s: %s, %s",(const char *)str1,
(const char *)rda->config()->stationName(),
(const char *)str2));
log_resize=true;
}
@@ -680,7 +689,7 @@ void MainWidget::quitMainWidget()
void MainWidget::resizeEvent(QResizeEvent *e)
{
if(log_log_list==NULL) {
if((log_log_list==NULL)||(!log_resize)) {
return;
}
log_filter_widget->setGeometry(10,10,size().width()-10,

View File

@@ -2,7 +2,7 @@
//
// The Log Editor Utility for Rivendell.
//
// (C) Copyright 2002-2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-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
@@ -36,13 +36,15 @@
#include <qcombobox.h>
#include <qlabel.h>
#include <rdlogfilter.h>
#include <rduser.h>
#include <rdripc.h>
#include <rdlibrary_conf.h>
#include <rdlog_line.h>
#include <rdlogfilter.h>
#include <rdripc.h>
#include <rduser.h>
#include <list_listviewitem.h>
#include "list_listviewitem.h"
#define RDLOGEDIT_USAGE "\n"
class MainWidget : public QMainWindow
{
@@ -98,6 +100,7 @@ class MainWidget : public QMainWindow
QString log_filter;
QString log_group;
QString log_schedcode;
bool log_resize;
};

View File

@@ -947,6 +947,10 @@ Vyhledejte svého správce systému kvůli aktualizaci!</translation>
<source>is in use by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RenderDialog</name>

View File

@@ -937,6 +937,10 @@ Fortfahren?</translation>
<source>is in use by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RenderDialog</name>

View File

@@ -943,6 +943,10 @@ See your system administrator for an update!</source>
<source>is in use by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RenderDialog</name>

View File

@@ -846,6 +846,10 @@ Report</source>
<source>is in use by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RenderDialog</name>

View File

@@ -955,6 +955,10 @@ Vil du halda fram?</translation>
<source>is in use by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RenderDialog</name>

View File

@@ -955,6 +955,10 @@ Vil du halda fram?</translation>
<source>is in use by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RenderDialog</name>

View File

@@ -934,6 +934,10 @@ Continuar?</translation>
<source>is in use by</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RenderDialog</name>