| 
 | 1 | +// cdlgdatepicker.cpp  | 
 | 2 | +//  | 
 | 3 | +// This file is part of the VSCP (https://www.vscp.org)  | 
 | 4 | +//  | 
 | 5 | +// The MIT License (MIT)  | 
 | 6 | +//  | 
 | 7 | +// Copyright © 2000-2023 Ake Hedman, Grodans Paradis AB  | 
 | 8 | + | 
 | 9 | +//  | 
 | 10 | +// Permission is hereby granted, free of charge, to any person obtaining a copy  | 
 | 11 | +// of this software and associated documentation files (the "Software"), to deal  | 
 | 12 | +// in the Software without restriction, including without limitation the rights  | 
 | 13 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell  | 
 | 14 | +// copies of the Software, and to permit persons to whom the Software is  | 
 | 15 | +// furnished to do so, subject to the following conditions:  | 
 | 16 | +//  | 
 | 17 | +// The above copyright notice and this permission notice shall be included in  | 
 | 18 | +// all copies or substantial portions of the Software.  | 
 | 19 | +//  | 
 | 20 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  | 
 | 21 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  | 
 | 22 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  | 
 | 23 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  | 
 | 24 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  | 
 | 25 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  | 
 | 26 | +// SOFTWARE.  | 
 | 27 | +//  | 
 | 28 | + | 
 | 29 | +#ifdef WIN32  | 
 | 30 | +#include <pch.h>  | 
 | 31 | +#endif  | 
 | 32 | + | 
 | 33 | +#include <vscp.h>  | 
 | 34 | +#include <vscphelper.h>  | 
 | 35 | + | 
 | 36 | +#include <vscpworks.h>  | 
 | 37 | + | 
 | 38 | +#include "cdlgdatepicker.h"  | 
 | 39 | +#include "ui_cdlgdatepicker.h"  | 
 | 40 | + | 
 | 41 | +#include <QMessageBox>  | 
 | 42 | +#include <QDebug>  | 
 | 43 | + | 
 | 44 | +#include <spdlog/async.h>  | 
 | 45 | +#include <spdlog/sinks/rotating_file_sink.h>  | 
 | 46 | +#include <spdlog/sinks/stdout_color_sinks.h>  | 
 | 47 | +#include <spdlog/spdlog.h>  | 
 | 48 | + | 
 | 49 | +///////////////////////////////////////////////////////////////////////////////  | 
 | 50 | +// CTor  | 
 | 51 | +//  | 
 | 52 | + | 
 | 53 | +CDlgDatePicker::CDlgDatePicker(QWidget *parent) :  | 
 | 54 | +    QDialog(parent),  | 
 | 55 | +    ui(new Ui::CDlgDatePicker)  | 
 | 56 | +{  | 
 | 57 | +    ui->setupUi(this);  | 
 | 58 | + | 
 | 59 | +    vscpworks *pworks = (vscpworks *)QCoreApplication::instance();          | 
 | 60 | + | 
 | 61 | +    //connect(ui->btnSetDummyGuid, &QPushButton::clicked, this, &cdlgdatepicker::setDummyGuid);  | 
 | 62 | +      | 
 | 63 | +    setInitialFocus();               | 
 | 64 | +}  | 
 | 65 | + | 
 | 66 | +///////////////////////////////////////////////////////////////////////////////  | 
 | 67 | +// DTor  | 
 | 68 | +//  | 
 | 69 | + | 
 | 70 | +CDlgDatePicker::~CDlgDatePicker()  | 
 | 71 | +{  | 
 | 72 | +    delete ui;  | 
 | 73 | +}  | 
 | 74 | + | 
 | 75 | +///////////////////////////////////////////////////////////////////////////////  | 
 | 76 | +// setInitialFocus  | 
 | 77 | +//  | 
 | 78 | + | 
 | 79 | +void CDlgDatePicker::setInitialFocus(void)  | 
 | 80 | +{  | 
 | 81 | +    // ui->editGuid->setFocus();  | 
 | 82 | +}  | 
 | 83 | + | 
 | 84 | +///////////////////////////////////////////////////////////////////////////////  | 
 | 85 | +// setEditMode  | 
 | 86 | +//  | 
 | 87 | + | 
 | 88 | +void CDlgDatePicker::setEditMode(void)  | 
 | 89 | +{  | 
 | 90 | +    // ui->editGuid->setReadOnly(true);  | 
 | 91 | +    // ui->btnSetDummyGuid->setVisible(false);  | 
 | 92 | +    // ui->editName->setFocus();  | 
 | 93 | +}  | 
 | 94 | + | 
 | 95 | +///////////////////////////////////////////////////////////////////////////////  | 
 | 96 | +// setDummyGuid  | 
 | 97 | +//  | 
 | 98 | + | 
 | 99 | +// void cdlgdatepicker::setDummyGuid(void)  | 
 | 100 | +// {  | 
 | 101 | +//     //ui->editGuid->setText("00:00:00:00:00:00:00:00:00:00:00:00:xx:xx:xx:xx");  | 
 | 102 | +// }  | 
 | 103 | + | 
 | 104 | + | 
 | 105 | +// ----------------------------------------------------------------------------  | 
 | 106 | +//                             Getters & Setters  | 
 | 107 | +// ----------------------------------------------------------------------------  | 
 | 108 | + | 
 | 109 | +///////////////////////////////////////////////////////////////////////////////  | 
 | 110 | +// getGuid  | 
 | 111 | +//  | 
 | 112 | + | 
 | 113 | +// QString cdlgdatepicker::getGuid(void)  | 
 | 114 | +// {  | 
 | 115 | +//     //return (ui->editGuid->text());   | 
 | 116 | +// }  | 
 | 117 | + | 
 | 118 | +///////////////////////////////////////////////////////////////////////////////  | 
 | 119 | +// setGuid  | 
 | 120 | +//  | 
 | 121 | + | 
 | 122 | +// void cdlgdatepicker::setGuid(const QString& str)  | 
 | 123 | +// {  | 
 | 124 | +//     //ui->editGuid->setText(str);  | 
 | 125 | +// }  | 
 | 126 | + | 
 | 127 | +///////////////////////////////////////////////////////////////////////////////  | 
 | 128 | +// getName  | 
 | 129 | +//  | 
 | 130 | + | 
 | 131 | +// QString cdlgdatepicker::getName(void)  | 
 | 132 | +// {  | 
 | 133 | +//     return (ui->editName->text());   | 
 | 134 | +// }  | 
 | 135 | + | 
 | 136 | +///////////////////////////////////////////////////////////////////////////////  | 
 | 137 | +// setName  | 
 | 138 | +//  | 
 | 139 | + | 
 | 140 | +// void cdlgdatepicker::setName(const QString& str)  | 
 | 141 | +// {  | 
 | 142 | +//     ui->editName->setText(str);  | 
 | 143 | +// }  | 
 | 144 | + | 
 | 145 | +///////////////////////////////////////////////////////////////////////////////  | 
 | 146 | +// getDescription  | 
 | 147 | +//  | 
 | 148 | + | 
 | 149 | +// QString cdlgdatepicker::getDescription(void)  | 
 | 150 | +// {  | 
 | 151 | +// #if QT_VERSION >= 0x050E00       | 
 | 152 | +//     //return (ui->editDescription->toMarkdown());  | 
 | 153 | +//     return (ui->editDescription->toPlainText());  | 
 | 154 | +// #else  | 
 | 155 | +//     return (ui->editDescription->toPlainText());  | 
 | 156 | +// #endif      | 
 | 157 | +// }  | 
 | 158 | + | 
 | 159 | +///////////////////////////////////////////////////////////////////////////////  | 
 | 160 | +// setDescription  | 
 | 161 | +//  | 
 | 162 | + | 
 | 163 | +// void cdlgdatepicker::setDescription(const QString& str)  | 
 | 164 | +// {  | 
 | 165 | +// #if QT_VERSION >= 0x050E00      | 
 | 166 | +//     ui->editDescription->setMarkdown(str);  | 
 | 167 | +// #else  | 
 | 168 | +//     ui->editDescription->setText(str);  | 
 | 169 | +// #endif      | 
 | 170 | +// }  | 
 | 171 | + | 
 | 172 | + | 
0 commit comments