void addFile() {
    struct fileList *pfile = NULL;
    
    pfile = (struct fileList *)malloc(sizeof(struct fileList));
    memset(pfile, 0, sizeof(struct fileList));
    
    refreshstdin();
    printf("Input file path:\n");
    scanf("%[^\n]", pfile->filePath);
    
    printf("Input protect type: r(read), w(write), h(hide), d(delete)\n");
    refreshstdin();
    scanf("%c", &pfile->type);
    
    pfile->next = NULL;
    
    //printf("%s@%c\n----\n", pfile->filePath, pfile->type);
    
    if (tail == NULL) {
        fileList_root = pfile;
        tail = fileList_root;
    }
    else {
        tail->next = pfile;
        tail = tail->next;
    }
    
    refreshFileList();
}
Пример #2
0
void DialogIDE::setupEditor()
{

    m_formats = new QFormatScheme("qxs/formats.qxf", this);
    QDocument::setDefaultFormatScheme(m_formats);

    QLineMarksInfoCenter::instance()->loadMarkTypes("qxs/marks.qxm");

    m_languages = new QLanguageFactory(m_formats, this);
    m_languages->addDefinitionPath("qxs");


    fill_inject();

    QFont font;
    font.setFamily("Courier");
    font.setFixedPitch(true);
    font.setPointSize(10);


    editor->setFont(font);
    editor->setTabStopWidth(40);

    highlighter = new Highlighter(editor->document());

//    QFile file("mainwindow.h");
//    if (file.open(QFile::ReadOnly | QFile::Text))
//        editor->setPlainText(file.readAll());
    refreshFileList();
}
Пример #3
0
TaskEditWidget::TaskEditWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::TaskEditWidget)
{
    ui->setupUi(this);
    
    editTask = 0;
    
    ui->specialJudge->setFilters(QDir::Files | QDir::Executable);
    connect(this, SIGNAL(dataPathChanged()),
            ui->specialJudge, SLOT(refreshFileList()));
    
    ui->sourceFileName->setValidator(new QRegExpValidator(QRegExp("\\w+"), this));
    ui->inputFileName->setValidator(new QRegExpValidator(QRegExp("(\\w+)(\\.\\w+)?"), this));
    ui->outputFileName->setValidator(new QRegExpValidator(QRegExp("(\\w+)(\\.\\w+)?"), this));
    ui->answerFileExtension->setValidator(new QRegExpValidator(QRegExp("\\w+"), this));
    
    connect(ui->problemTitle, SIGNAL(textChanged(QString)),
            this, SLOT(problemTitleChanged(QString)));
    connect(ui->traditionalButton, SIGNAL(toggled(bool)),
            this, SLOT(setToTraditional(bool)));
    connect(ui->answersOnlyButton, SIGNAL(toggled(bool)),
            this, SLOT(setToAnswersOnly(bool)));
    connect(ui->sourceFileName, SIGNAL(textChanged(QString)),
            this, SLOT(sourceFileNameChanged(QString)));
    connect(ui->inputFileName, SIGNAL(textChanged(QString)),
            this, SLOT(inputFileNameChanged(QString)));
    connect(ui->outputFileName, SIGNAL(textChanged(QString)),
            this, SLOT(outputFileNameChanged(QString)));
    connect(ui->standardInputCheck, SIGNAL(stateChanged(int)),
            this, SLOT(standardInputCheckChanged()));
    connect(ui->standardOutputCheck, SIGNAL(stateChanged(int)),
            this, SLOT(standardOutputCheckChanged()));
    connect(ui->comparisonMode, SIGNAL(currentIndexChanged(int)),
            this, SLOT(comparisonModeChanged()));
    connect(ui->diffArguments, SIGNAL(textChanged(QString)),
            this, SLOT(diffArgumentsChanged(QString)));
    connect(ui->realPrecision, SIGNAL(valueChanged(int)),
            this, SLOT(realPrecisionChanged(int)));
    connect(ui->specialJudge, SIGNAL(textChanged(QString)),
            this, SLOT(specialJudgeChanged(QString)));
    connect(ui->compilersList, SIGNAL(currentRowChanged(int)),
            this, SLOT(compilerSelectionChanged()));
    connect(ui->configurationSelect, SIGNAL(currentIndexChanged(int)),
            this, SLOT(configurationSelectionChanged()));
    connect(ui->answerFileExtension, SIGNAL(textChanged(QString)),
            this, SLOT(answerFileExtensionChanged(QString)));
}
Пример #4
0
/*!
 \brief

*/
void WindowIDE::setupEditor()
{

    m_formats = new QFormatScheme(":/QXS/formats.qxf", this);
    QDocument::setDefaultFormatScheme(m_formats);

    QLineMarksInfoCenter::instance()->loadMarkTypes(":QXS/marks.qxm");

    m_languages = new QLanguageFactory(m_formats, this);
    m_languages->addDefinitionPath(":QXS");



    refreshFileList();

    ui->vardockWidget->hide();
    ui->procdockWidget->hide();

}
Пример #5
0
MainWindow::MainWindow(QWidget* parent) : QWidget(parent) {
    fileList = new QListWidget();
    status = new QLabel();
    status->setWordWrap(true);
    fileName = new QLabel();
    connect(fileList, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(selectItem(QListWidgetItem*)));

    previewButton = new QPushButton("Preview this file");
    connect(previewButton, SIGNAL(clicked()), this, SLOT(doPreview()));
    refreshButton = new QPushButton("Refresh");
    connect(refreshButton, SIGNAL(clicked()), this, SLOT(refreshFileList()));

    QVBoxLayout *videoLayout = new QVBoxLayout();
    videoUrl = new KUrlRequester(this);
    videoUrl->setFilter(QString("*.flv"));
    videoUrl->setMode(KFile::File | KFile::LocalOnly);
    videoUrl->lineEdit()->setReadOnly(true);
    connect(videoUrl, SIGNAL(urlSelected(const KUrl&)), this, SLOT(appendFLV(const KUrl&)));
    exportVideo = new QPushButton("Save as flv (video and audio)");
    connect(exportVideo, SIGNAL(clicked()), this, SLOT(doExportVideo()));
    videoLayout->addWidget(new QLabel("Choose a location:"));
    videoLayout->addWidget(videoUrl);
    videoLayout->addWidget(exportVideo);
    QGroupBox *videoGroup = new QGroupBox("Save Video", this);
    videoGroup->setLayout(videoLayout);

    QVBoxLayout *mp3Layout = new QVBoxLayout();
    mp3Title = new KLineEdit(this);
    mp3Artist = new KLineEdit(this);
    mp3Album = new KLineEdit(this);
    mp3Url = new KUrlRequester(this);
    mp3Url->setFilter(QString("*.mp3"));
    mp3Url->setMode(KFile::File | KFile::LocalOnly);
    mp3Url->lineEdit()->setReadOnly(true);
    connect(mp3Url, SIGNAL(urlSelected(const KUrl&)), this, SLOT(appendMp3(const KUrl&)));
    exportmp3 = new QPushButton("Save as mp3 (audio only)");
    connect(exportmp3, SIGNAL(clicked()), this, SLOT(doExportMp3()));
    mp3Layout->addWidget(new QLabel("Enter audio title:"));
    mp3Layout->addWidget(mp3Title);
    mp3Layout->addWidget(new QLabel("Enter artist (optional):"));
    mp3Layout->addWidget(mp3Artist);
    mp3Layout->addWidget(new QLabel("Enter album (optional):"));
    mp3Layout->addWidget(mp3Album);
    mp3Layout->addWidget(new QLabel("Choose a location:"));
    mp3Layout->addWidget(mp3Url);
    mp3Layout->addWidget(exportmp3);
    QGroupBox *mp3Group = new QGroupBox("Save Audio", this);
    mp3Group->setLayout(mp3Layout);

    QHBoxLayout* outermost = new QHBoxLayout();
    QVBoxLayout* rightPanel = new QVBoxLayout();
    QVBoxLayout* leftPanel = new QVBoxLayout();
    leftPanel->addWidget(new QLabel("Youtube Video cache files found:"));
    leftPanel->addWidget(fileList);
    leftPanel->addWidget(refreshButton);
    rightPanel->addWidget(fileName);
    rightPanel->addWidget(previewButton);
    rightPanel->addWidget(videoGroup);
    rightPanel->addWidget(mp3Group);
    rightPanel->addWidget(status);
    outermost->addLayout(leftPanel);
    outermost->addLayout(rightPanel);
    setLayout(outermost);

    refreshFileList();
}