Esempio n. 1
0
void ConfigWidget::init()
{
    this->setWindowTitle(QString("%1 - %2")
                         .arg(APP_NAME)
                         .arg(tr("Config")));

    QString fullHotkey = _settings->value("general/fullhotkey", DEFAULT_HOTKEY_FULL).toString();
    QString partHotkey = _settings->value("general/parthotkey", DEFAULT_HOTKEY_PART).toString();
    QString codeHotkey = _settings->value("general/texthotkey", DEFAULT_HOTKEY_CODE).toString();

    showTypes(fullHotkey, partHotkey, codeHotkey);

    QString imagetype = _settings->value("general/imagetype", DEFAULT_IMAGE_TYPE).toString();
    QString sourcestype = _settings->value("general/sourcetype", DEFAULT_SOURCES_TYPE).toString();
    bool showsourcedialog = _settings->value("general/showsourcedialog", DEFAULT_SHOW_SOURCES_CONF_DIALOG).toBool();

    int imgIndex = _ui.comboImageType->findData(imagetype);
    if (imgIndex != -1) {
        _ui.comboImageType->setCurrentIndex(imgIndex);
    }

    int srcIndex = _ui.comboSourcesType->findData(sourcestype);
    if (srcIndex != -1) {
        _ui.comboSourcesType->setCurrentIndex(srcIndex);
    }

    QString uuid = _settings->value("general/uuid").toString();
    QString regText = tr("<a href=\"http://pastexen.com/register.php?uuid=%1\">Register & attach client</a>")
            .arg(uuid);
    _ui.regLabel->setText(regText);
    qDebug() << regText;
    _ui.checkBoxLangDialogShow->setChecked(showsourcedialog);
}
Esempio n. 2
0
void ConfigWidget::init()
{
    this->setWindowTitle(QString("%1 - %2")
                         .arg(APP_NAME)
                         .arg(tr("Config")));

    QString fullHotkey = Application::settings().GetParameter("general/fullhotkey", DEFAULT_HOTKEY_FULL);
    QString partHotkey = Application::settings().GetParameter("general/parthotkey", DEFAULT_HOTKEY_PART);
    QString codeHotkey = Application::settings().GetParameter("general/texthotkey", DEFAULT_HOTKEY_CODE);

    showTypes(fullHotkey, partHotkey, codeHotkey);

    QString imagetype = Application::settings().GetParameter("general/imagetype", DEFAULT_IMAGE_TYPE);
    QString sourcestype = Application::settings().GetParameter("general/sourcetype", DEFAULT_SOURCES_TYPE);
    bool showsourcedialog = Application::settings().GetParameter("general/showsourcedialog", ToString(DEFAULT_SHOW_SOURCES_CONF_DIALOG));

    int imgIndex = _ui.comboImageType->findData(imagetype);
    if (imgIndex != -1) {
        _ui.comboImageType->setCurrentIndex(imgIndex);
    }

    int srcIndex = _ui.comboSourcesType->findData(sourcestype);
    if (srcIndex != -1) {
        _ui.comboSourcesType->setCurrentIndex(srcIndex);
    }

    QString regText = tr("<a href=\"%1\">My account</a>"
                         " (you need to share file first)")
            .arg(Application::GetAccountUrl());
    _ui.regLabel->setText(regText);
    _ui.checkBoxLangDialogShow->setChecked(showsourcedialog);
}
Esempio n. 3
0
void MainWindow::createActions() {
    mNewFileAction = new QAction(QIcon(":/images/new.png"), tr("&New"), this);
    mNewFileAction->setShortcut(QKeySequence::New);
    mNewFileAction->setStatusTip(tr("Open a new file"));
    connect(mNewFileAction, SIGNAL(triggered()), this, SLOT(newBlankPage()));

    mOpenFileAction = new QAction(QIcon(":/images/open.png"), tr("&Open"), this);
    mOpenFileAction->setShortcut(QKeySequence::Open);
    mOpenFileAction->setStatusTip(tr("Open file"));
    connect(mOpenFileAction, SIGNAL(triggered()), this, SLOT(openPage()));

    mSaveFileAction = new QAction(QIcon(":/images/save.png"), tr("&Save"), this);
    mSaveFileAction->setShortcut(QKeySequence::Save);
    mSaveFileAction->setStatusTip(tr("Save file"));
    connect(mSaveFileAction, SIGNAL(triggered()), this, SLOT(saveTab()));

    mSaveAsFileAction = new QAction(QIcon(":/images/saveAs.png"), tr("Save &As"), this);
    mSaveAsFileAction->setShortcut(QKeySequence::SaveAs);
    mSaveAsFileAction->setStatusTip(tr("Save file as"));
    connect(mSaveAsFileAction, SIGNAL(triggered()), this, SLOT(savePageAs()));

    mExitAction = new QAction(tr("&Exit"), this);
    mExitAction->setShortcut(QKeySequence::Quit);
    mExitAction->setStatusTip(tr("Exit the application"));
    connect(mExitAction, SIGNAL(triggered()), this, SLOT(close()));

    /* Project Actions */
    mNewProjectAction = new QAction(tr("New Project"), this);
    mNewFileAction->setStatusTip(tr("Creates a new Project"));
    connect(mNewProjectAction, SIGNAL(triggered()), this, SLOT(newProject()));

    mOpenProjectAction = new QAction(tr("Open Project"), this);
    mOpenProjectAction->setStatusTip(tr("Open an existing project"));

    mSaveProjectAction = new QAction(tr("Save Project"), this);
    mSaveProjectAction->setStatusTip(tr("Save current project"));

    mSaveProjectAsAction = new QAction(tr("Save Project As"), this);
    mSaveProjectAsAction->setStatusTip(tr("Save current project as"));

    mShowProjectViewAction = new QAction(tr("Show Project View"), this);
    mShowProjectViewAction->setStatusTip(tr("Show Project Settings and Properties"));
    connect(mShowProjectViewAction, SIGNAL(triggered()), this, SLOT(showProjectView()));

    mShowTransistionDiagramAction = new QAction(tr("Show Transistion Diagram"), this);
    mShowTransistionDiagramAction->setStatusTip(tr("Show the Projects Transistion Diagram"));
    connect(mShowTransistionDiagramAction, SIGNAL(triggered()), this, SLOT(showTransistionDiagram()));

    mGenerateHOLAction = new QAction(tr("Generate HOL"), this);
    mGenerateHOLAction->setStatusTip(tr("Generate all the HOL files for the project"));

    mGenerateHaskellAction = new QAction(tr("Generate Haskell"), this);
    mGenerateHaskellAction->setStatusTip(tr("Generate all the Haskell files for the project"));

    mGenerateDocAction = new QAction(tr("Generate Documentation"), this);
    mGenerateDocAction->setStatusTip(tr("Generate Documentation for project"));

    mCloseProjectAction = new QAction(tr("Close project"), this);
    mCloseProjectAction->setStatusTip(tr("Closes the current project"));

    /* Edit Actions */

    mUndoAction = new QAction(tr("&Undo"), this);
    mUndoAction->setShortcut(QKeySequence::Undo);
    mUndoAction->setStatusTip(tr("Undo"));
    connect(mUndoAction, SIGNAL(triggered()), this, SLOT(undo()));

    mRedoAction = new QAction(tr("&Redo"), this);
    mRedoAction->setShortcut(QKeySequence::Redo);
    mRedoAction->setStatusTip(tr("Redo"));
    connect(mRedoAction, SIGNAL(triggered()), this, SLOT(redo()));

    mCutAction = new QAction(tr("&Cut"), this);
    mCutAction->setShortcut(QKeySequence::Cut);
    mCutAction->setStatusTip(tr("Cut"));
    connect(mCutAction, SIGNAL(triggered()), this, SLOT(cut()));

    mCopyAction = new QAction(tr("&Copy"), this);
    mCopyAction->setShortcut(QKeySequence::Copy);
    mCopyAction->setStatusTip(tr("Copy"));
    connect(mCopyAction, SIGNAL(triggered()), this, SLOT(copy()));

    mPasteAction = new QAction(tr("&Paste"), this);
    mPasteAction->setShortcut(QKeySequence::Paste);
    mPasteAction->setStatusTip(tr("Paste"));
    connect(mPasteAction, SIGNAL(triggered()), this, SLOT(paste()));

    mSelectAllAction = new QAction(tr("Select &All"), this);
    mSelectAllAction->setShortcut(QKeySequence::SelectAll);
    mSelectAllAction->setStatusTip(tr("Select All"));
    connect(mSelectAllAction, SIGNAL(triggered()), this, SLOT(selectAll()));

    mFindReplaceAction = new QAction(tr("&Find/Replace"), this);
    mFindReplaceAction->setShortcut(QKeySequence::Find);
    mFindReplaceAction->setStatusTip(tr("Find/Replace"));
    connect(mSelectAllAction, SIGNAL(triggered()), this, SLOT(findReplace()));

    /* HOL Menu Actions */
    mHOLRestartAction = new QAction(tr("Restart HOL"), this);
    mHOLRestartAction->setStatusTip(tr("Restart the HOL buffer"));
    connect(mHOLRestartAction, SIGNAL(triggered()), mHOLWidget, SLOT(restart()));

    mHOLSendRegionToAction = new QAction(tr("Send Region to HOL"), this);
    mHOLSendRegionToAction->setStatusTip(tr("Sends the highlighted region to the HOL buffer"));
    //connect

    mHOLRunHolmakeAction = new QAction(tr("Run Holmake"), this);
    mHOLRunHolmakeAction->setStatusTip(tr("Runs Holamake in current directory"));
    connect(mHOLRunHolmakeAction, SIGNAL(triggered()), this, SLOT(runHolmake()));

    mHOLShowTypesAction = new QAction(tr("Show Types"), this);
    mHOLShowTypesAction->setStatusTip(tr("Show Types"));
    connect(mHOLShowTypesAction, SIGNAL(triggered()), mHOLWidget, SLOT(showTypes()));

    mHOLShowTypesVerboseAction = new QAction(tr("Show Types Verbosely"), this);
    mHOLShowTypesVerboseAction->setStatusTip(tr("Show Types Verbosely"));
    connect(mHOLShowTypesVerboseAction, SIGNAL(triggered()), mHOLWidget, SLOT(showTypesVerbose()));

    mHOLShowNumericalTypesAction = new QAction(tr("Show Numerical Types"), this);
    mHOLShowNumericalTypesAction->setStatusTip(tr("Show Numerical Types"));
    connect(mHOLShowNumericalTypesAction, SIGNAL(triggered()), mHOLWidget, SLOT(showNumericalTypes()));

    mHOLShowAssumptionsAction = new QAction(tr("Show Assumptions"), this);
    mHOLShowAssumptionsAction->setStatusTip(tr("Show Assumptions"));
    connect(mHOLShowAssumptionsAction, SIGNAL(triggered()), mHOLWidget, SLOT(showAssumptions()));

    /* Help Menu Actions */
    mHOLDocumentationAction = new QAction(tr("HOL Documentation"), this);
    mHOLDocumentationAction->setStatusTip(tr("Show HOL Documentation"));

    mAboutAction = new QAction(tr("About"), this);
    mAboutAction->setStatusTip(tr("About"));

    /* Transistion Diagram Actions */
    mAddStateAction = new QAction(tr("Add State"), this);
    mAddStateAction->setStatusTip("Add a new State to the Transistion Diagram");

    mDeleteStateAction = new QAction(tr("Remove State"), this);
    mDeleteStateAction->setStatusTip("Remove state from Transistion Diagram");

    mMakeLinkAction = new QAction(tr("Connect States"), this);
    mMakeLinkAction->setStatusTip("Connect two states");

    mDeleteLinkAction = new QAction(tr("Remove Link"), this);
    mDeleteLinkAction->setStatusTip("Remove the Link between two States");

    mStatePropertiesAction = new QAction(tr("State Properties"), this);
    mStatePropertiesAction->setStatusTip("Display the Properties of the State");

    mZoomInAction = new QAction(tr("Zoom In"), this);
    mZoomInAction->setStatusTip("Zoom In on the Diagrams");

    mZoomOutAction = new QAction(tr("Zoom Out"), this);
    mZoomOutAction->setStatusTip("Zoom Out on the Diagram");
}