Ejemplo n.º 1
0
short TSystemError::sysErr( short errorCode, uchar drive )
{
    ushort c = ( (TScreen::screenMode & 0x00FF) != TDisplay::smMono  ) ?
                                        sysColorAttr : sysMonoAttr;
    char s[ 63 ];
    TDrawBuffer b;

//  bug-fix TV2B-31 ---------------------------------------
    /* There are 22 documented device errors, all of which have their
     * own strings in errorString[].  However, just in case we run into
     * something weird this will prevent a crash.
     */
//  end of bug-fix. ---------------------------------------
    if( errorCode < (sizeof(errorString) / sizeof(errorString[0])) )
        sprintf( s, errorString[ errorCode ], drive + 'A' );
    else
        sprintf( s, "Unknown critical error %d on drive %c", errorCode, drive + 'A' );

// modification #TV2N-04 ----------------------------------
    // EFW - Modified to be screen size aware.
    b.moveChar( 0, ' ', c, TScreen::screenWidth);
    b.moveCStr( 1, s, c);
    b.moveCStr( TScreen::screenWidth - cstrlen(sRetryOrCancel) - 1,
        sRetryOrCancel, c);
// end of modification ------------------------------------
    swapStatusLine(b);
    int res = selectKey();
    swapStatusLine(b);
    return res;
}
Ejemplo n.º 2
0
/* QPythonParamDialog */
QPythonParamDialog::QPythonParamDialog(QWidget* parent)
                  : QDialog(parent)
{
    setWindowTitle(tr("Python Parameter"));

    fTypeBox = new QComboBox(this);
    fID = new QSpinBox(this);
    fID->setRange(0, 0x7FFFFFFF);
    fKeyValue = new QLinkLabel("(Null)", this);
    fStringValue = new QLineEdit(this);
    fIntValue = new QIntEdit(this);
    fFloatValue = new QFloatEdit(this);
    fBoolValue = new QComboBox(this);
    fBoolValue->addItem("false");
    fBoolValue->addItem("true");
    fLabelNull = new QLabel("(Null)", this);
    QDialogButtonBox* buttonBox = new QDialogButtonBox(Qt::Horizontal, this);
    buttonBox->setStandardButtons(QDialogButtonBox::Cancel |
                                  QDialogButtonBox::Ok);

    fKeyValue->setVisible(false);
    fStringValue->setVisible(false);
    fIntValue->setVisible(false);
    fFloatValue->setVisible(false);
    fBoolValue->setVisible(false);

    for (int i=1; i<=plPythonParameter::kNone; i++)
        fTypeBox->addItem(s_PythonParamTypes[i]);

    QGridLayout* layout = new QGridLayout(this);
    layout->setHorizontalSpacing(8);
    layout->setVerticalSpacing(8);
    layout->addWidget(new QLabel(tr("ID:"), this), 0, 0);
    layout->addWidget(fID, 0, 1, 1, 2);
    layout->addWidget(new QLabel(tr("Type:"), this), 1, 0);
    layout->addWidget(fTypeBox, 1, 1, 1, 2);
    layout->addWidget(new QLabel(tr("Value:"), this), 2, 0);
    layout->addWidget(fKeyValue, 2, 1);
    layout->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding), 2, 2);
    layout->addWidget(fStringValue, 2, 1, 1, 2);
    layout->addWidget(fIntValue, 2, 1, 1, 2);
    layout->addWidget(fFloatValue, 2, 1, 1, 2);
    layout->addWidget(fBoolValue, 2, 1, 1, 2);
    layout->addWidget(fLabelNull, 2, 1, 1, 2);
    layout->addWidget(buttonBox, 3, 0, 1, 3);

    connect(fTypeBox, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged(int)));
    connect(fKeyValue, SIGNAL(activated()), this, SLOT(selectKey()));
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    fTypeBox->setCurrentIndex(plPythonParameter::kNone-1);
}
Ejemplo n.º 3
0
int KeySelectorControl::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = ConfigControl::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setTheKey(); break;
        case 1: selectKey((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 2: selectKey((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break;
        case 3: selectKey(); break;
        case 4: select((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 5: select((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break;
        case 6: select(); break;
        case 7: select1Key(); break;
        case 8: filter((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 9;
    }
    return _id;
}
Ejemplo n.º 4
0
Frame::Frame(QWidget *parent) : QFrame(parent) {
    this->resize(Config::FrameWidth, Config::FrameHeight);
    this->setMinimumSize(Config::FrameWidth, Config::FrameHeight);
    this->setMaximumSize(Config::FrameWidth, Config::FrameHeight);
    this->setWindowFlags(Qt::FramelessWindowHint);
    this->setStyleSheet(Config::FrameStyleSheet);

    _titlebar = new TitleBar(this);
    _toolbar = new ToolBar(this);
    _panel = new PanelWin(this);
    _statebar = new StateBar(this);

    _layout = new QVBoxLayout(this);
    _layout->setSpacing(0);
    _layout->setMargin(0);
    _layout->addWidget(_titlebar);
    _layout->addWidget(_toolbar);
    _layout->addWidget(_panel);
    _layout->addWidget(_statebar);


    connect(_titlebar->_btnMin, SIGNAL(clicked()), this, SLOT(minwin()));
    connect(_titlebar->_btnClose, SIGNAL(clicked()), this, SLOT(closewin()));

    connect(_toolbar->_btnKey, SIGNAL(clicked()), _panel, SLOT(selectKey()));
    connect(_toolbar->_btnCust, SIGNAL(clicked()), _panel, SLOT(selectCust()));


    connect(_panel->_btnExtractStart, SIGNAL(clicked()), this, SLOT(extractStart()));
    connect(_panel->_btnExtractCancel, SIGNAL(clicked()), this, SLOT(extractCancel()));


    connect(_panel->_btnSearchBrowse, SIGNAL(clicked()), this, SLOT(openFolder()));
    connect(_panel->_btnSearchStart, SIGNAL(clicked()), this, SLOT(searchStart()));
    connect(_panel->_btnSearchCancel, SIGNAL(clicked()), this, SLOT(searchCancel()));
    connect(_panel->_btnClearLogs, SIGNAL(clicked()), this, SLOT(clearLogs()));

    connect(_panel->_btnBackupBrowse, SIGNAL(clicked()), this, SLOT(openFolder()));
    connect(_panel->_btnBackupStart, SIGNAL(clicked()), this, SLOT(backupStart()));
    connect(_panel->_btnBackupCancel, SIGNAL(clicked()), this, SLOT(backupCancel()));


    _panel->_btnSearchCancel->setEnabled(false);
    _panel->_btnBackupCancel->setEnabled(false);
    _panel->_btnClearLogs->setEnabled(false);

  }
Ejemplo n.º 5
0
short TSystemError::sysErr( short errorCode, uchar drive )
{
    ushort c = ( (TScreen::screenMode & 0x00fF) != TDisplay::smMono  ) ?
                                        sysColorAttr : sysMonoAttr;
    char s[ 63 ];
    TDrawBuffer b;

    sprintf( s, errorString[ errorCode ], drive + 'a' );

    b.moveChar( 0, ' ', c, 80);
    b.moveCStr( 1, s, c);
    b.moveCStr( 79-cstrlen(sRetryOrCancel), sRetryOrCancel, c);
    swapStatusLine(b);
    int res = selectKey();
    swapStatusLine(b);
    return res;
}
Ejemplo n.º 6
0
short TSystemError::sysErr( short errorCode, uchar drive )
{
    ushort c = ( (TScreen::screenMode & 0x00FF) != TDisplay::smMono  ) ?
                                        sysColorAttr : sysMonoAttr;
    char s[ 63 ];
    TDrawBuffer b;

    /* There are 16 documented device errors, all of which have their
     * own strings in errorString[].  However, just in case we run into
     * something weird this will prevent a crash.
     */
    if( errorCode < (sizeof(errorString) / sizeof(errorString[0])) )
        sprintf( s, errorString[ errorCode ], drive + 'A' );
    else
        sprintf( s, "Unknown critical error %d on drive %c", errorCode, drive + 'A' );

    b.moveChar( 0, ' ', c, 80);
    b.moveCStr( 1, s, c);
    b.moveCStr( 79-cstrlen(sRetryOrCancel), sRetryOrCancel, c);
    swapStatusLine(b);
    int res = selectKey();
    swapStatusLine(b);
    return res;
}