Esempio n. 1
0
FilePreviewWidget::FilePreviewWidget(QWidget* parent) :
		FileWatcherWidget(parent, "FilePreviewWidget", "File Preview"),
	mTextDocument(new QTextDocument(this)),
	mTextEdit(new QTextEdit(this)),
	mSaveButton(new QPushButton("Save", this))
{
	this->setToolTip("Preview and edit a file");
	mSyntaxHighlighter = NULL;
  connect(mSaveButton, SIGNAL(clicked()), this, SLOT(saveSlot()));
  mSaveButton->setEnabled(false);

  QHBoxLayout* buttonLayout = new QHBoxLayout();
  buttonLayout->addStretch();
  buttonLayout->setMargin(0);
  buttonLayout->addWidget(mSaveButton);

  QVBoxLayout* layout = new QVBoxLayout(this);
  layout->setMargin(0);
  layout->addWidget(mTextEdit);
  layout->addLayout(buttonLayout);

  connect(mTextEdit, SIGNAL(textChanged()), this, SLOT(textChangedSlot()));
  mTextEdit->setDocument(mTextDocument);
  mTextEdit->setLineWrapMode(QTextEdit::NoWrap);

  this->setSyntaxHighLighter<snw::SyntaxHighlighter>();
}
Esempio n. 2
0
ChatMainWindow::ChatMainWindow()
    : m_nickname(QLatin1String("nickname"))
{
    setupUi(this);
    sendButton->setEnabled(false);

    connect(messageLineEdit, SIGNAL(textChanged(QString)),
            this, SLOT(textChangedSlot(QString)));
    connect(sendButton, SIGNAL(clicked(bool)), this, SLOT(sendClickedSlot()));
    connect(actionChangeNickname, SIGNAL(triggered(bool)), this, SLOT(changeNickname()));
    connect(actionAboutQt, SIGNAL(triggered(bool)), this, SLOT(aboutQt()));
    connect(qApp, SIGNAL(lastWindowClosed()), this, SLOT(exiting()));

    // add our D-Bus interface and connect to D-Bus
    new ChatAdaptor(this);
    QDBusConnection::sessionBus().registerObject("/", this);

    com::trolltech::chat *iface;
    iface = new com::trolltech::chat(QString(), QString(), QDBusConnection::sessionBus(), this);
    //connect(iface, SIGNAL(message(QString,QString)), this, SLOT(messageSlot(QString,QString)));
    QDBusConnection::sessionBus().connect(QString(), QString(), "com.trolltech.chat", "message", this, SLOT(messageSlot(QString,QString)));
    connect(iface, SIGNAL(action(QString,QString)), this, SLOT(actionSlot(QString,QString)));

    NicknameDialog dialog;
    dialog.cancelButton->setVisible(false);
    dialog.exec();
    m_nickname = dialog.nickname->text().trimmed();
    emit action(m_nickname, QLatin1String("joins the chat"));
}
Esempio n. 3
0
GPlainTextEdit::GPlainTextEdit(QWidget *parent,VM *pVM)  : QPlainTextEdit(parent)
{
	this->pVM = pVM;
	this->pParaList = ring_list_new(0);
	strcpy(this->cblockCountChangedEvent,"");
	strcpy(this->ccopyAvailableEvent,"");
	strcpy(this->ccursorPositionChangedEvent,"");
	strcpy(this->cmodificationChangedEvent,"");
	strcpy(this->credoAvailableEvent,"");
	strcpy(this->cselectionChangedEvent,"");
	strcpy(this->ctextChangedEvent,"");
	strcpy(this->cundoAvailableEvent,"");
	strcpy(this->cupdateRequestEvent,"");

	QObject::connect(this, SIGNAL(blockCountChanged(int)),this, SLOT(blockCountChangedSlot()));
	QObject::connect(this, SIGNAL(copyAvailable(bool)),this, SLOT(copyAvailableSlot()));
	QObject::connect(this, SIGNAL(cursorPositionChanged()),this, SLOT(cursorPositionChangedSlot()));
	QObject::connect(this, SIGNAL(modificationChanged(bool)),this, SLOT(modificationChangedSlot()));
	QObject::connect(this, SIGNAL(redoAvailable(bool)),this, SLOT(redoAvailableSlot()));
	QObject::connect(this, SIGNAL(selectionChanged()),this, SLOT(selectionChanged()));
	QObject::connect(this, SIGNAL(textChanged()),this, SLOT(textChangedSlot()));
	QObject::connect(this, SIGNAL(undoAvailable(bool)),this, SLOT(undoAvailableSlot()));
	QObject::connect(this, SIGNAL(updateRequest(const QRect, int)),this, SLOT(updateRequestSlot()));

}
Esempio n. 4
0
AssembleDialog::AssembleDialog(QWidget* parent) :
    QDialog(parent),
    ui(new Ui::AssembleDialog)
{
    ui->setupUi(this);
    setModal(true);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint | Qt::MSWindowsFixedSizeDialogHint);

    mSelectedInstrVa = 0;
    bKeepSizeChecked = false;
    bFillWithNopsChecked = false;
    setKeepSizeLabel("");

    mValidateThread = new ValidateExpressionThread(this);
    mValidateThread->setOnExpressionChangedCallback(std::bind(&AssembleDialog::validateInstruction, this, std::placeholders::_1));

    connect(ui->lineEdit, SIGNAL(textChanged(QString)), this, SLOT(textChangedSlot(QString)));
    connect(mValidateThread, SIGNAL(instructionChanged(dsint, QString)), this, SLOT(instructionChangedSlot(dsint, QString)));
    mValidateThread->start();

    duint setting;
    if(BridgeSettingGetUint("Engine", "Assembler", &setting))
    {
        if(setting == 1)
            ui->radioKeystone->setChecked(true);
        else if(setting == 2)
            ui->radioAsmjit->setChecked(true);
    }
}
Esempio n. 5
0
VoxOxToolTipLineEdit::VoxOxToolTipLineEdit(QWidget * parent)
	: QLineEdit(0) {

	_parentWidget = parent;//VOXOX CHANGE by Rolando - 2009.05.22 - varible to send focus when it is needed

	LANGUAGE_CHANGE(this);

	_primaryStyleSheet = QString("QWidget{ border: none; color: white; background: black; }");
	_secondaryStyleSheet = QString("QWidget{ border: none; color: gray; background: black; }");

	SAFE_CONNECT(this, SIGNAL(textChanged(QString)), SLOT(textChangedSlot(QString)));//VOXOX CHANGE Rolando 03-24-09
	SAFE_CONNECT(this, SIGNAL(textEdited(QString)), SLOT(textChangedSlot(QString)));//VOXOX CHANGE Rolando 03-24-09

	_shortMessage = "";
	_message = "";

	init();
}
Esempio n. 6
0
PgxEditor::PgxEditor(Database *database, QString editor_name)
{
    ++editor_widow_id;
    this->database = database;
    this->editor_name = editor_name;
    createActions();
    breakpointArea = new BreakPointArea(this);
    lineNumberArea = new LineNumberArea(this);
    setStyleSheet("QPlainTextEdit{background-color: white; font: bold 14px 'Courier New';}");
    highlighter = new Highlighter(document());

    toolbar = new QToolBar;
    toolbar->setIconSize(QSize(36,36));
    toolbar->setObjectName("pgxeditor");
    toolbar->setMovable(false);
    toolbar->addAction(newpgxeditor_action);
    toolbar->addAction(cut_action);
    toolbar->addAction(copy_action);
    toolbar->addAction(paste_action);
    if(!editor_name.isEmpty()) {
        toolbar->addSeparator();
        toolbar->addAction(save_action);
        toolbar->addSeparator();
        toolbar->addAction(execute_action);
    }
    toolbar->addSeparator();
    toolbar->addAction(selected_execute_action);
    toolbar->addAction(wrap_action);
    toolbar->addAction(find_action);

    pgxeditor_mainwin = new PgxEditorMainWindow;
    pgxeditor_mainwin->addToolBar(toolbar);
    pgxeditor_mainwin->setCentralWidget(this);
    pgxeditor_mainwin->setAttribute(Qt::WA_DeleteOnClose);

    find_bar = new QLineEdit;
    find_bar->setPlaceholderText(tr("Find"));
    find_bar->setVisible(false);
    pgxeditor_mainwin->statusBar()->setSizeGripEnabled(false);
    pgxeditor_mainwin->statusBar()->addPermanentWidget(casesensitivity_button, 0);
    pgxeditor_mainwin->statusBar()->addPermanentWidget(wholeword_button, 0);
    pgxeditor_mainwin->statusBar()->addPermanentWidget(backwards_button, 0);
    pgxeditor_mainwin->statusBar()->addPermanentWidget(find_bar);
    replace_bar = new QLineEdit;
    replace_bar->setPlaceholderText(tr("Replace"));
    replace_bar->setVisible(false);
    pgxeditor_mainwin->statusBar()->addPermanentWidget(replace_bar);

    connect(find_bar, SIGNAL(returnPressed()), this, SLOT(findText()));
    connect(replace_bar, SIGNAL(returnPressed()), this, SLOT(replaceText()));
    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));
    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));
    connect(this, SIGNAL(selectionChanged()), this, SLOT(selectionChangedSlot()));
    connect(this, SIGNAL(textChanged()), this, SLOT(textChangedSlot()));
    connect(pgxeditor_mainwin, SIGNAL(pgxeditorClosing()), this, SLOT(pgxeditorClosing()));
    updateLineNumberAreaWidth(0);
}
TranslationLine::TranslationLine(QWidget *parent)
	: QTextEdit(parent)
{
	fixingSize=false;
	setWordWrapMode(QTextOption::WrapAnywhere);
	setTabChangesFocus(true);
	setAcceptRichText(false);
    setMinimumWidth(100);
	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	connect(this,SIGNAL(textChanged()),this,SLOT(textChangedSlot()));
}
Esempio n. 8
0
GLineEdit::GLineEdit(QWidget *parent,VM *pVM)  : QLineEdit(parent)
{
	this->pVM = pVM;
	strcpy(this->cTextChangedEvent,"");
	strcpy(this->ccursorPositionChangedEvent,"");
	strcpy(this->ceditingFinishedEvent,"");
	strcpy(this->creturnPressedEvent,"");
	strcpy(this->cselectionChangedEvent,"");
	strcpy(this->ctextEditedEvent,"");

	QObject::connect(this, SIGNAL(textChanged(QString)),this, SLOT(textChangedSlot()));
	QObject::connect(this, SIGNAL(cursorPositionChanged(int,int)),this, SLOT(cursorPositionChangedSlot()));
	QObject::connect(this, SIGNAL(editingFinished()),this, SLOT(editingFinishedSlot()));
	QObject::connect(this, SIGNAL(returnPressed()),this, SLOT(returnPressedSlot()));
	QObject::connect(this, SIGNAL(selectionChanged()),this, SLOT(selectionChangedSlot()));
	QObject::connect(this, SIGNAL(textEdited(QString)),this, SLOT(textEditedSlot()));

}
Esempio n. 9
0
void CodeEditorWidget::linkCodeWithComments() {

	connect(m_codeEditor, SIGNAL(commentsScrollRequestSignal(int)), 
		m_commentsArea, SLOT(codeScrolledSlot(int)));
	connect(m_commentsArea, SIGNAL(codeScrollRequestSignal(int)), 
		m_codeEditor, SLOT(commentsScrolledSlot(int)));
	connect(m_codeEditor, SIGNAL(commentsUpdateRequestSignal(int)), 
		m_commentsArea, SLOT(codeBlockCountChangedSlot(int)));
	connect(m_commentsArea, SIGNAL(applyCommentsSignal()), 
		m_codeEditor, SLOT(applyCommentsSlot()), Qt::DirectConnection);
	connect(m_codeEditor, SIGNAL(codeCursorLineChangedSignal(int)), 
		m_commentsArea, SLOT(codePositionChangedSlot(int)), Qt::DirectConnection);
	connect(m_commentsArea, SIGNAL(commentsCursorLineChangedSignal(int)), 
		m_codeEditor, SLOT(commentsPositionChangedSlot(int)), Qt::DirectConnection);
	connect(m_commentsArea, SIGNAL(commentsChangedSignal()), m_codeEditor, SLOT(textChangedSlot()));

	m_commentsArea->codeBlockCountChangedSlot(m_codeEditor->blockCount());

	if (GlobalState::instance()->eventFilter() != NULL) {
		m_codeEditor->installEventFilter(GlobalState::instance()->eventFilter());
		m_commentsArea->installEventFilter(GlobalState::instance()->eventFilter());
	}
}