Ejemplo n.º 1
0
SearchResults::SearchResults(QWidget *parent) :
    QWidget(parent)
{
    QVBoxLayout* mainLayout = new QVBoxLayout(this);
    mainLayout->setMargin(0);

    mModel = new SearchResultModel(this);
    mDelegate = new SearchResultDelegate(mModel, this);

    mTreeView = new QTreeView(this);
    mTreeView->setModel(mModel);
    mTreeView->setItemDelegate(mDelegate);
    mTreeView->setHeaderHidden(true);
    mainLayout->addWidget(mTreeView);

    QHBoxLayout* childLayout = new QHBoxLayout();
    mainLayout->addLayout(childLayout);
    childLayout->setMargin(5);

    mReplaceLabel = new QLabel(tr("Replace With: "), this);
    mReplaceLabel->setMargin(5);
    childLayout->addWidget(mReplaceLabel);

    mReplaceWithText = new QLineEdit(this);
    mReplaceWithText->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    childLayout->addWidget(mReplaceWithText);

    mReplaceButton = new QPushButton(tr("Replace"), this);
    mReplaceLabel->setMargin(5);
    childLayout->addWidget(mReplaceButton);

    connect(mTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
    connect(mReplaceButton, SIGNAL(clicked()), this, SLOT(replaceClicked()));
}
Ejemplo n.º 2
0
void Window::initializeDialogs()
{
	// Create our dialog objects.

	preferencesDialog = new PreferencesDialog(this);

	findDialog = new FindDialog(this);

	replaceDialog = new ReplaceDialog(this);

	goToDialog = new GoToDialog(this);

	aboutDialog = new AboutDialog(this);

	// Connect our dialog actions.

	QObject::connect(findDialog, SIGNAL(accepted()), this,
	                 SLOT(doFindNext()));
	QObject::connect(replaceDialog, SIGNAL(replaceClicked()), this,
	                 SLOT(doReplace()));
	QObject::connect(replaceDialog, SIGNAL(findClicked()), this,
	                 SLOT(doReplaceFind()));
	QObject::connect(replaceDialog, SIGNAL(replaceSelectionClicked()), this,
	                 SLOT(doReplaceSelection()));
	QObject::connect(replaceDialog, SIGNAL(replaceAllClicked()), this,
	                 SLOT(doReplaceAll()));
	QObject::connect(goToDialog, SIGNAL(accepted()), this,
	                 SLOT(doGoToAccepted()));
}
Ejemplo n.º 3
0
/*
 * Initialize
 */
void MovieSequenceForm::init()
{
  setAttribute(Qt::WA_DeleteOnClose);
  setAttribute(Qt::WA_AlwaysShowToolTips);
  mSegments = mvMovieSegmentArray();
  connect(doneButton, SIGNAL(clicked()), this, SLOT(close()));
  connect(addAfterButton, SIGNAL(clicked()), this, SLOT(addAfterClicked()));
  connect(addBeforeButton, SIGNAL(clicked()), this, SLOT(addBeforeClicked()));
  connect(replaceButton, SIGNAL(clicked()), this, SLOT(replaceClicked()));
  connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
  connect(setMovieButton, SIGNAL(clicked()), this, SLOT(setMovieClicked()));
  connect(setStartButton, SIGNAL(clicked()), this, SLOT(setStartClicked()));
  connect(setEndButton, SIGNAL(clicked()), this, SLOT(setEndClicked()));
  connect(runAllButton, SIGNAL(clicked()), this, SLOT(runAllClicked()));
  connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
  connect(loadButton, SIGNAL(clicked()), this, SLOT(loadClicked()));
  connect(helpButton, SIGNAL(clicked()), this, SLOT(helpClicked()));
  connect(table, SIGNAL(cellChanged(int, int)), this, SLOT(entryChanged(int,int)));
  setFontDependentWidths();
  mModified = false;

  // Change window size to give 4 rows plus header
  imod_info_input();
  adjustSize();
  QSize winSize = sizeHint();
  QSize tableSize = table->sizeHint();
  int desired = 5.6 * (table->fontMetrics().height() + 3);
  resize(winSize.width(), winSize.height() + (desired - tableSize.height()));
}
Ejemplo n.º 4
0
ShortcutCaptureDialog::ShortcutCaptureDialog(Shortcut* _s, QMap<QString, Shortcut*> ls, QWidget* parent)
   : QDialog(parent)
      {
      setupUi(this);
      setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
      localShortcuts = ls;
      s = _s;

      addButton->setEnabled(false);
      replaceButton->setEnabled(false);
      oshrtLabel->setText(s->keysToString());
      oshrtLabel->setEnabled(false);
      connect(clearButton, SIGNAL(clicked()), SLOT(clearClicked()));
      connect(addButton, SIGNAL(clicked()), SLOT(addClicked()));
      connect(replaceButton, SIGNAL(clicked()), SLOT(replaceClicked()));
      clearClicked();

      nshrtLabel->installEventFilter(this);
      }
Ejemplo n.º 5
0
GuiSearch::GuiSearch(GuiView & lv)
	: GuiDialog(lv, "findreplace", qt_("Find and Replace"))
{
	setupUi(this);

	connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
	connect(findPB, SIGNAL(clicked()), this, SLOT(findClicked()));
	connect(replacePB, SIGNAL(clicked()), this, SLOT(replaceClicked()));
	connect(replaceallPB, SIGNAL(clicked()), this, SLOT(replaceallClicked()));
	connect(findCO, SIGNAL(editTextChanged(QString)),
		this, SLOT(findChanged()));

	setFocusProxy(findCO);

	bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
	bc().setCancel(closePB);
	bc().addReadOnly(replaceCO);
	bc().addReadOnly(replacePB);
	bc().addReadOnly(replaceallPB);

	replacePB->setEnabled(false);
	replaceallPB->setEnabled(false);
}