Esempio n. 1
0
void cDockNavigation::ConnectSignals() const
{
	// ------------ camera manipulation -----------
	connect(ui->bu_move_up, SIGNAL(clicked()), this, SLOT(slotCameraMove()));
	connect(ui->bu_move_down, SIGNAL(clicked()), this, SLOT(slotCameraMove()));
	connect(ui->bu_move_left, SIGNAL(clicked()), this, SLOT(slotCameraMove()));
	connect(ui->bu_move_right, SIGNAL(clicked()), this, SLOT(slotCameraMove()));
	connect(ui->bu_move_forward, SIGNAL(clicked()), this, SLOT(slotCameraMove()));
	connect(ui->bu_move_backward, SIGNAL(clicked()), this, SLOT(slotCameraMove()));

	connect(ui->bu_rotate_up, SIGNAL(clicked()), this, SLOT(slotCameraRotation()));
	connect(ui->bu_rotate_down, SIGNAL(clicked()), this, SLOT(slotCameraRotation()));
	connect(ui->bu_rotate_left, SIGNAL(clicked()), this, SLOT(slotCameraRotation()));
	connect(ui->bu_rotate_right, SIGNAL(clicked()), this, SLOT(slotCameraRotation()));
	connect(ui->bu_rotate_roll_left, SIGNAL(clicked()), this, SLOT(slotCameraRotation()));
	connect(ui->bu_rotate_roll_right, SIGNAL(clicked()), this, SLOT(slotCameraRotation()));

	connect(ui->vect3_camera_x, SIGNAL(editingFinished()), this, SLOT(slotCameraOrTargetEdited()));
	connect(ui->vect3_camera_y, SIGNAL(editingFinished()), this, SLOT(slotCameraOrTargetEdited()));
	connect(ui->vect3_camera_z, SIGNAL(editingFinished()), this, SLOT(slotCameraOrTargetEdited()));
	connect(ui->vect3_target_x, SIGNAL(editingFinished()), this, SLOT(slotCameraOrTargetEdited()));
	connect(ui->vect3_target_y, SIGNAL(editingFinished()), this, SLOT(slotCameraOrTargetEdited()));
	connect(ui->vect3_target_z, SIGNAL(editingFinished()), this, SLOT(slotCameraOrTargetEdited()));
	connect(ui->vect3_camera_rotation_x, SIGNAL(editingFinished()), this, SLOT(slotRotationEdited()));
	connect(ui->vect3_camera_rotation_y, SIGNAL(editingFinished()), this, SLOT(slotRotationEdited()));
	connect(ui->vect3_camera_rotation_z, SIGNAL(editingFinished()), this, SLOT(slotRotationEdited()));
	connect(ui->logedit_camera_distance_to_target, SIGNAL(editingFinished()), this,
		SLOT(slotCameraDistanceEdited()));
	connect(ui->comboBox_camera_absolute_distance_mode, SIGNAL(currentIndexChanged(int)), this,
		SLOT(slotMovementStepModeChanged(int)));
	connect(ui->comboBox_camera_movement_mode, SIGNAL(currentIndexChanged(int)), this,
		SLOT(slotCameraMovementModeChanged(int)));
	connect(ui->pushButton_undo, SIGNAL(clicked()), this, SLOT(slotUndo()));
	connect(ui->pushButton_redo, SIGNAL(clicked()), this, SLOT(slotRedo()));
	connect(ui->pushButton_render, SIGNAL(clicked()), this, SLOT(slotStartRender()));

	connect(ui->pushButton_stop, SIGNAL(clicked()), this, SLOT(slotStopRender()));
	connect(ui->pushButton_reset_view, SIGNAL(clicked()), this, SLOT(slotPressedButtonResetView()));
}
Esempio n. 2
0
EntryDlg::EntryDlg(
  KMainWindow   *main,
  kvoctrainDoc  *doc,
  bool           multi_sel,
  bool           origin,
  grade_t        f_grd,
  grade_t        t_grd,
  count_t        f_qcount,
  count_t        t_qcount,
  count_t        f_bcount,
  count_t        t_bcount,
  time_t         f_qdate,
  time_t         t_qdate,
  QString        f_faux_ami,
  QString        t_faux_ami,
  QString        expr,
  int            lesson,
  QComboBox     *lessonbox,
  QString        lang,
  LangSet       &langset,
  QString        rem,
  QString        type,
  QString        pronunce,
  QString        synonym,
  QString        antonym,
  QString        example,
  QString        usagelabel,
  QString        paraphrase,
  const          Conjugation &con_prefix,
  const          Conjugation &conjugations,
  const          Article &/*article*/,
  const          Comparison &comp,
  const          MultipleChoice &mc,
  QueryManager  &querymanager,
  const QString &title,
  bool           active,
  const QFont&   ipafont,
  QWidget       *parent,
  const char    *name,
  bool           modal)
  :
  KDialogBase(Tabbed, title, User1|User2|User3|Apply|Close, Apply, parent, name, modal, false,
    KGuiItem(i18n("&Reset")),
    KGuiItem(QString::null, "view_left_right"),
    KGuiItem(QString::null, "view_top_bottom"))

{
  mainwin = main;
  docked = false;
  edit_row = -1;
  edit_col = -1;
  from_page = 0;
  to_page = 0;

  QString s;
  if (langset.findLongId(lang).isEmpty() )
    s = lang;
  else
    s = langset.findLongId(lang);

  QFrame *page;
  QVBoxLayout *topLayout;

  if (origin)
  {
    page = addPage( i18n("Co&mmon") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    comm_page = new CommonEntryPage (this, doc, multi_sel, expr, lesson, lessonbox,
                                      lang, type, pronunce, usagelabel,
                                      i18n("Original &expression in %1:").arg(s), querymanager, active,
                                      ipafont, page, name);
    topLayout->addWidget(comm_page);

    page = addPage( i18n("A&dditional") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    aux_page = new AuxInfoEntryPage (this, multi_sel, synonym, antonym, example, rem, paraphrase, page, name);
    topLayout->addWidget(aux_page);

    page = addPage( i18n("&Multiple Choice") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    mc_page = new MCEntryPage (this, multi_sel, mc, page, "MultipleChoice");
    topLayout->addWidget(mc_page);

    page = addPage( i18n("Con&jugation") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    tense_page = new TenseEntryPage (this, multi_sel, con_prefix, conjugations, page, "Conjugation");
    topLayout->addWidget(tense_page);

    page = addPage( i18n("Compar&ison") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    adj_page = new AdjEntryPage (this, multi_sel, comp, page, "Comparison");
    topLayout->addWidget(adj_page);
  }
  else
  {
    page = addPage( i18n("Co&mmon") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    comm_page = new CommonEntryPage (this, doc, multi_sel, expr, lesson, lessonbox,
                                      lang, type, pronunce, usagelabel,
                                      i18n("Translated &expression in %1:").arg(s), querymanager, active,
                                      ipafont, page, name);
    topLayout->addWidget(comm_page);

    page = addPage( i18n("A&dditional") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    aux_page = new AuxInfoEntryPage (this, multi_sel, synonym, antonym, example, rem, paraphrase, page, name);
    topLayout->addWidget(aux_page);

    page = addPage( i18n("&Multiple Choice") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    mc_page = new MCEntryPage (this, multi_sel, mc, page, "MultipleChoice");
    topLayout->addWidget(mc_page);

    page = addPage( i18n("Con&jugation") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    tense_page = new TenseEntryPage (this, multi_sel, con_prefix, conjugations, page, "Conjugation");
    topLayout->addWidget(tense_page);

    page = addPage( i18n("Compar&ison") );
    topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
    adj_page = new AdjEntryPage (this, multi_sel, comp, page, "Comparison");
    topLayout->addWidget(adj_page);
  }

  page = addPage( i18n("&From Original") );
  topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
  from_page = new FromToEntryPage (this, multi_sel, f_grd, f_qdate, f_qcount, f_bcount,
                                    f_faux_ami,
                                    i18n("Properties From Original"), page, name);
  topLayout->addWidget(from_page);

  page = addPage( i18n("&To Original") );
  topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
  to_page   = new FromToEntryPage (this, multi_sel, t_grd, t_qdate, t_qcount, t_bcount,
                                    t_faux_ami,
                                    i18n("Properties to Original"), page, name);
  topLayout->addWidget(to_page);

  updatePages (type);

  connect(comm_page, SIGNAL(typeSelected(const QString&)), SLOT(updatePages(const QString&)) );

  connect( this, SIGNAL(user1Clicked()), this, SLOT(slotUndo()) );
  connect( this, SIGNAL(applyClicked()), this, SLOT(slotApply()) );
  connect( this, SIGNAL(user2Clicked()), this, SLOT(slotDockVertical()) );
  connect( this, SIGNAL(user3Clicked()), this, SLOT(slotDockHorizontal()) );

  connect (comm_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));
  connect (aux_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));
  connect (adj_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));
  connect (mc_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));
  connect (tense_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));

  if (from_page != 0)
    connect (from_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));
  if (to_page != 0)
    connect (to_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() ));

  enableButtonApply(false);
  enableButton(User1, false);
  comm_page->expr_line->setFocus();
}
Esempio n. 3
0
void MainWindow::initMenu()
{
	//file
	_fileMenu = menuBar()->addMenu(QWidget::tr("文件(&F)"));
	QAction* actionNewFile = new QAction(QIcon(":/images/new.png"), QWidget::tr("新建(&New)"), this);
	actionNewFile->setShortcut(QWidget::tr("Ctrl+N"));
	actionNewFile->setToolTip(QWidget::tr("新建场景文件"));
	connect(actionNewFile, SIGNAL(triggered()), this, SLOT(slotNewFile()));
	_fileMenu->addAction(actionNewFile);
	QAction* actionOpenFile = new QAction(QIcon(":/images/open.png"), QWidget::tr("打开(&Open)"), this);
	actionOpenFile->setShortcut(QWidget::tr("Ctrl+O"));
	actionOpenFile->setToolTip(QWidget::tr("打开一个场景文件"));
	connect(actionOpenFile, SIGNAL(triggered()), this, SLOT(slotOpenFile()));
	_fileMenu->addAction(actionOpenFile);
	QAction* actionSaveFile = new QAction(QIcon(":/images/save.png"), QWidget::tr("保存(&Save)"), this);
	actionSaveFile->setShortcut(QWidget::tr("Ctrl+S"));
	actionSaveFile->setToolTip(QWidget::tr("保存场景文件"));
	actionSaveFile->setEnabled(false);
	connect(actionSaveFile, SIGNAL(triggered()), this, SLOT(slotSaveFile()));
	_fileMenu->addAction(actionSaveFile);
	QAction* actionSaveAsFile = new QAction(QIcon(":/images/save.png"), QWidget::tr("另存(SaveAs)"), this);
	actionSaveAsFile->setToolTip(QWidget::tr("另存场景文件"));
	actionSaveAsFile->setEnabled(false);
	connect(actionSaveAsFile, SIGNAL(triggered()), this, SLOT(slotSaveAsFile()));
	_fileMenu->addAction(actionSaveAsFile);
	QAction* actionExit = new QAction(QIcon(":/images/close.png"), QWidget::tr("退出(&X)"), this);
	actionExit->setToolTip(QWidget::tr("退出场景编辑器"));
	connect(actionExit, SIGNAL(triggered()), this, SLOT(slotExit()));
	_fileMenu->addAction(actionExit);
	//edit
	_editMenu = menuBar()->addMenu(QWidget::tr("编辑(&E)"));
	QAction* actionUndo = new QAction(QIcon(":/images/undo.png"), QWidget::tr("撤销"), this);
	actionUndo->setShortcut(QWidget::tr("Ctrl+Z"));
	actionUndo->setToolTip(QWidget::tr("撤销Ctrl+Z"));
	actionUndo->setEnabled(false);
	connect(actionUndo, SIGNAL(triggered()), this, SLOT(slotUndo()));
	_editMenu->addAction(actionUndo);
	QAction* actionRedo = new QAction(QIcon(":/images/redo.png"), QWidget::tr("重做"), this);
	actionRedo->setShortcut(QWidget::tr("Ctrl+Y"));
	actionRedo->setToolTip(QWidget::tr("重做Ctrl+Y"));
	actionRedo->setEnabled(false);
	connect(actionRedo, SIGNAL(triggered()), this, SLOT(slotRedo()));
	_editMenu->addAction(actionRedo);
	QAction* actionCopy = new QAction(QIcon(":/images/copy.png"), QWidget::tr("复制"), this);
	actionCopy->setShortcut(QWidget::tr("Ctrl+C"));
	actionCopy->setToolTip(QWidget::tr("复制Ctrl+C"));
	actionCopy->setEnabled(false);
	connect(actionCopy, SIGNAL(triggered()), this, SLOT(slotCopy()));
	_editMenu->addAction(actionCopy);
	QAction* actionRotateFast = new QAction(QIcon(":/images/rotate.png"), QWidget::tr("快速旋转"), this);
	actionRotateFast->setShortcut(QKeySequence(Qt::Key_F3));
	actionRotateFast->setToolTip(QWidget::tr("快速旋转F3"));
	actionRotateFast->setEnabled(false);
	connect(actionRotateFast, SIGNAL(triggered()), this, SLOT(slotRotateFast()));
	_editMenu->addAction(actionRotateFast);
	QAction* actionAlign = new QAction(QIcon(":/images/align.png"), QWidget::tr("对齐"), this);
	actionAlign->setShortcut(QWidget::tr("Ctrl+L"));
	actionAlign->setToolTip(QWidget::tr("对齐Ctrl+L"));
	actionAlign->setEnabled(false);
	connect(actionAlign, SIGNAL(triggered()), this, SLOT(slotAlign()));
	_editMenu->addAction(actionAlign);
	QAction* actionDelete = new QAction(QIcon(":/images/delete.png"), QWidget::tr("删除"), this);
	actionDelete->setShortcut(QKeySequence(QKeySequence::Delete));
	actionDelete->setToolTip(QWidget::tr("删除Delete"));
	actionDelete->setEnabled(false);
	connect(actionDelete, SIGNAL(triggered()), this, SLOT(slotDelete()));
	_editMenu->addAction(actionDelete);
	//windowsMenu
	_windowsMenu = menuBar()->addMenu(QWidget::tr("窗口(&W)"));
	QAction* actionObjectsTreeDockWidget = new QAction(QIcon(":/images/default.png"), QWidget::tr("场景树(&ObjTree)"), this);
	actionObjectsTreeDockWidget->setShortcut(QKeySequence("h"));
	actionObjectsTreeDockWidget->setToolTip(QWidget::tr("打开或隐藏对象树窗口"));
	actionObjectsTreeDockWidget->setEnabled(false);
	connect(actionObjectsTreeDockWidget, SIGNAL(triggered()), this, SLOT(slotObjectTreeWidgetActive()));
	_windowsMenu->addAction(actionObjectsTreeDockWidget);
	QAction* actionPropertyDockWidget = new QAction(QIcon(":/images/default.png"), QWidget::tr("属性窗"), this);
	actionPropertyDockWidget->setToolTip(QWidget::tr("打开或隐藏属性窗口"));
	actionPropertyDockWidget->setEnabled(false);
	connect(actionPropertyDockWidget, SIGNAL(triggered()), this, SLOT(slotPropertyDockWidgetActive()));
	_windowsMenu->addAction(actionPropertyDockWidget);
	QAction* actionBuiltinResourcesDockWidget = new QAction(QIcon(":/images/default.png"), QWidget::tr("内置资源列表"), this);
	actionBuiltinResourcesDockWidget->setToolTip(QWidget::tr("打开或隐藏内置资源列表窗口"));
	actionBuiltinResourcesDockWidget->setEnabled(false);
	connect(actionBuiltinResourcesDockWidget, SIGNAL(triggered()), this, SLOT(slotBuiltinResourcesDockWidgetActive()));
	_windowsMenu->addAction(actionBuiltinResourcesDockWidget);
	QAction* actionvdsResourcesDockWidget = new QAction(QIcon(":/images/default.png"), QWidget::tr("资源列表"), this);
	actionvdsResourcesDockWidget->setToolTip(QWidget::tr("打开或隐藏资源列表窗口"));
	actionvdsResourcesDockWidget->setEnabled(false);
	connect(actionvdsResourcesDockWidget, SIGNAL(triggered()), this, SLOT(slotvdsResourcesDockWidgetActive()));
	_windowsMenu->addAction(actionvdsResourcesDockWidget);
	QAction* actionCSharpAssemblyDockWidget = new QAction(QIcon(":/images/default.png"), QWidget::tr("脚本列表"), this);
	actionCSharpAssemblyDockWidget->setToolTip(QWidget::tr("打开或隐藏脚本列表窗口"));
	actionCSharpAssemblyDockWidget->setEnabled(false);
	connect(actionCSharpAssemblyDockWidget, SIGNAL(triggered()), this, SLOT(slotCSharpAssemblyDockWidgetActive()));
	_windowsMenu->addAction(actionCSharpAssemblyDockWidget);
	//tool
	_toolMenu = menuBar()->addMenu(QWidget::tr("工具(&T)"));
	QAction* actionAnimationMerge = new QAction(QIcon(":/images/default.png"), QWidget::tr("动画合并(&AnimationMerge)"), this);
	actionAnimationMerge->setToolTip(QWidget::tr("完成骨骼动画合并"));
	actionAnimationMerge->setEnabled(false);
	connect(actionAnimationMerge, SIGNAL(triggered()), this, SLOT(slotAnimationMerge()));
	_toolMenu->addAction(actionAnimationMerge);
	QAction* particleEdit = new QAction(QIcon(":/images/default.png"), QWidget::tr("粒子编辑(&Particle)"), this);
	particleEdit->setToolTip(QWidget::tr("编辑粒子效果"));
	particleEdit->setEnabled(false);
	connect(particleEdit, SIGNAL(triggered()), this, SLOT(slotParticleEdit()));
	_toolMenu->addAction(particleEdit);
	QAction* actionPlantBrushDockWidget = new QAction(QIcon(":/images/default.png"), QWidget::tr("植被编辑"), this);
	actionPlantBrushDockWidget->setToolTip(QWidget::tr("打开或隐藏植被编辑窗口"));
	actionPlantBrushDockWidget->setEnabled(false);
	connect(actionPlantBrushDockWidget, SIGNAL(triggered()), this, SLOT(slotPlantBrushDockWidgetActive()));
	_toolMenu->addAction(actionPlantBrushDockWidget);
	QAction* actionViewPointEdit = new QAction(QIcon(":/images/default.png"), QWidget::tr("视点编辑(&ViewPoint)"), this);
	actionViewPointEdit->setToolTip(QWidget::tr("定义视点"));
	actionViewPointEdit->setEnabled(false);
	connect(actionViewPointEdit, SIGNAL(triggered()), this, SLOT(slotViewPointEdit()));
	_toolMenu->addAction(actionViewPointEdit);
	QAction* actionPhysicalEdit = new QAction(QIcon(":/images/default.png"), QWidget::tr("物理编辑"), this);
	actionPhysicalEdit->setToolTip(QWidget::tr("定义碰撞体或碰撞面"));
	actionPhysicalEdit->setEnabled(false);
	connect(actionPhysicalEdit, SIGNAL(triggered()), this, SLOT(slotPhysicalEditDockWidgetActive()));
	_toolMenu->addAction(actionPhysicalEdit);
	QAction* actionRiverEdit = new QAction(QIcon(":/images/default.png"), QWidget::tr("河流编辑"), this);
	actionRiverEdit->setToolTip(QWidget::tr("定义河流效果"));
	actionRiverEdit->setEnabled(false);
	connect(actionRiverEdit, SIGNAL(triggered()), this, SLOT(slotRiverEditDockWidgetActive()));
	_toolMenu->addAction(actionRiverEdit);
	QAction* modelConvert = new QAction(QIcon(":/images/default.png"), QWidget::tr("模型转换(&ConvertModel)"), this);
	modelConvert->setToolTip(QWidget::tr("转换模型到其他平台"));
	modelConvert->setEnabled(true);
	connect(modelConvert, SIGNAL(triggered()), this, SLOT(slotConvertModel()));
	_toolMenu->addAction(modelConvert);
	QAction* compressDir = new QAction(QIcon(":/images/default.png"), QWidget::tr("压缩文件夹"), this);
	compressDir->setToolTip(QWidget::tr("压缩文件夹,可以设定文件名编码"));
	compressDir->setEnabled(true);
	connect(compressDir, SIGNAL(triggered()), this, SLOT(slotCompressDir()));
	_toolMenu->addAction(compressDir);
	//animation
	_animationMenu = menuBar()->addMenu(QWidget::tr("动画(&A)"));
	///////////////////////////////////////////////////////////////////should move to PlotAnimation later
	QAction* actionViewPointAnimationEdit = new QAction(QIcon(":/images/default.png"), QWidget::tr("视点动画编辑"), this);
	actionViewPointAnimationEdit->setToolTip(QWidget::tr("编辑视点动画"));
	actionViewPointAnimationEdit->setEnabled(false);
	connect(actionViewPointAnimationEdit, SIGNAL(triggered()), this, SLOT(slotViewPointAnimationEdit()));
	_animationMenu->addAction(actionViewPointAnimationEdit);
	QAction* actionPlotAnimationEdit = new QAction(QIcon(":/images/default.png"), QWidget::tr("剧情编辑"), this);
	actionPlotAnimationEdit->setToolTip(QWidget::tr("编辑一段剧情"));
	actionPlotAnimationEdit->setEnabled(false);
	connect(actionPlotAnimationEdit, SIGNAL(triggered()), this, SLOT(slotPlotAnimationEdit()));
	_animationMenu->addAction(actionPlotAnimationEdit);
}
Esempio n. 4
0
DlgControllerLearning::DlgControllerLearning(QWidget * parent,
                                             Controller* controller)
        : QDialog(parent),
          m_pMidiController(NULL),
          m_controlPickerMenu(this),
          m_messagesLearned(false) {
    qRegisterMetaType<MixxxControl>("MixxxControl");
    qRegisterMetaType<MidiKeyAndOptionsList>("MidiKeyAndOptionsList");

    setupUi(this);
    labelMappedTo->setText("");
    // Ensure the first page is always shown regardless of the last page shown
    // when the .ui file was saved.
    stackedWidget->setCurrentIndex(0);

    // Delete this dialog when its closed. We don't want any persistence.
    setAttribute(Qt::WA_DeleteOnClose);
    setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint);

    connect(pushButtonChooseControl, SIGNAL(clicked()), this, SLOT(showControlMenu()));
    connect(pushButtonDone, SIGNAL(clicked()), this, SLOT(close()));
    // The undo button doesn't become active until we have mapped a control.
    pushButtonUndo->setEnabled(false);
    connect(pushButtonUndo, SIGNAL(clicked()), this, SLOT(slotUndo()));
    connect(&m_actionMapper, SIGNAL(mapped(int)), this, SLOT(controlChosen(int)));

    midiOptions->setEnabled(false);
    // We only want to listen to clicked() so we don't fire
    // slotMidiOptionsChanged when we change the checkboxes programmatically.
    connect(midiOptionSwitchMode, SIGNAL(clicked()),
            this, SLOT(slotMidiOptionsChanged()));
    connect(midiOptionSoftTakeover, SIGNAL(clicked()),
            this, SLOT(slotMidiOptionsChanged()));
    connect(midiOptionInvert, SIGNAL(clicked()),
            this, SLOT(slotMidiOptionsChanged()));
    connect(midiOptionSelectKnob, SIGNAL(clicked()),
            this, SLOT(slotMidiOptionsChanged()));

    // Get the underlying type of the Controller. This will call
    // one of the visit() methods below immediately.
    controller->accept(this);

    m_deckStr = tr("Deck %1");
    m_samplerStr = tr("Sampler %1");
    m_previewdeckStr = tr("Preview Deck %1");
    m_resetStr = tr("Reset to default");

    // Master Controls
    QMenu* mixerMenu = addSubmenu(tr("Mixer"));
    addControl("[Master]", "crossfader", tr("Crossfader"), mixerMenu, true);
    addControl("[Master]", "volume", tr("Master volume"), mixerMenu, true);
    addControl("[Master]", "balance", tr("Master balance"), mixerMenu, true);
    addControl("[Master]", "headVolume", tr("Headphone volume"), mixerMenu, true);
    addControl("[Master]", "headMix", tr("Headphone mix (pre/main)"), mixerMenu, true);

    // Transport
    QMenu* transportMenu = addSubmenu(tr("Transport"));
    addDeckAndPreviewDeckControl("playposition", tr("Strip-search through track"), transportMenu);
    addDeckAndSamplerAndPreviewDeckControl("play", tr("Play button"), transportMenu);
    addDeckControl("volume", tr("Volume fader"), transportMenu, true);
    addDeckControl("back", tr("Fast rewind button"), transportMenu);
    addDeckControl("fwd", tr("Fast forward button"), transportMenu);
    addDeckAndSamplerAndPreviewDeckControl("start", tr("Jump to start of track"), transportMenu);
    addDeckControl("end", tr("Jump to end of track"), transportMenu);
    addDeckControl("reverse", tr("Play reverse button"), transportMenu);
    addDeckControl("reverseroll", tr("Reverse roll (Censor) button"), transportMenu);
    addDeckAndSamplerAndPreviewDeckControl("pregain", tr("Gain knob"), transportMenu, true);
    addDeckAndSamplerControl("pfl", tr("Headphone listen button"), transportMenu);
    addDeckAndSamplerControl("mute", tr("Mute button"), transportMenu);
    addDeckAndSamplerControl("repeat", tr("Toggle repeat mode"), transportMenu);
    addDeckAndSamplerAndPreviewDeckControl("eject", tr("Eject track"), transportMenu);
    addSamplerControl("orientation", tr("Mix orientation (e.g. left, right, center)"), transportMenu);
    addDeckAndSamplerControl("slip_enabled", tr("Toggle slip mode"), transportMenu);

    // BPM & Sync
    QMenu* bpmMenu = addSubmenu(tr("BPM and Sync"));
    addDeckAndSamplerControl("bpm_tap", tr("BPM tap button"), bpmMenu);
    addDeckControl("beats_translate_curpos", tr("Adjust beatgrid"), bpmMenu);
    addDeckAndSamplerControl("quantize", tr("Toggle quantize mode"), bpmMenu);
    addDeckAndSamplerControl("beatsync", tr("Beat sync (tempo and phase)"), bpmMenu);
    addDeckAndSamplerControl("beatsync_tempo", tr("Beat sync (tempo only)"), bpmMenu);
    addDeckAndSamplerControl("beatsync_phase", tr("Beat sync (phase only)"), bpmMenu);

    // Rate
    QMenu* rateMenu = addSubmenu(tr("Pitch and Rate"));
    addDeckAndSamplerControl("keylock", tr("Toggle keylock mode"), rateMenu);
    addDeckAndSamplerControl("rate", tr("Speed control slider"), rateMenu, true);
    addDeckAndSamplerControl("pitch", tr("Pitch control slider"), rateMenu, true);
    addDeckControl("rate_perm_up", tr("Adjust rate up (coarse)"), rateMenu);
    addDeckControl("rate_perm_up_small", tr("Adjust rate up (fine)"), rateMenu);
    addDeckControl("rate_perm_down", tr("Adjust rate down (coarse)"), rateMenu);
    addDeckControl("rate_perm_down_small", tr("Adjust rate down (fine)"), rateMenu);
    addDeckControl("rate_temp_up", tr("Pitch-bend rate up (coarse)"), rateMenu);
    addDeckControl("rate_temp_up_small", tr("Pitch-bend rate up (fine)"), rateMenu);
    addDeckControl("rate_temp_down", tr("Pitch-bend rate down (coarse)"), rateMenu);
    addDeckControl("rate_temp_down_small", tr("Pitch-bend rate down (fine)"), rateMenu);

    // EQs
    QMenu* eqMenu = addSubmenu(tr("Equalizers"));
    addDeckControl("filterHigh", tr("High EQ knob"), eqMenu, true);
    addDeckControl("filterMid", tr("Mid EQ knob"), eqMenu, true);
    addDeckControl("filterLow", tr("Low EQ knob"), eqMenu, true);
    addDeckControl("filterHighKill", tr("High EQ kill"), eqMenu);
    addDeckControl("filterMidKill", tr("Mid EQ kill"), eqMenu);
    addDeckControl("filterLowKill", tr("Low EQ kill"), eqMenu);

    // Vinyl Control
    QMenu* vinylControlMenu = addSubmenu(tr("Vinyl Control"));
    addDeckControl("vinylcontrol_enabled", tr("Toggle vinyl-control (ON/OFF)"), vinylControlMenu);
    addDeckControl("vinylcontrol_cueing", tr("Toggle vinyl-control cueing mode (OFF/ONE/HOT)"), vinylControlMenu);
    addDeckControl("vinylcontrol_mode", tr("Toggle vinyl-control mode (ABS/REL/CONST)"), vinylControlMenu);
    addDeckControl("passthrough", tr("Pass through external audio into the internal mixer"), vinylControlMenu);
    addControl(VINYL_PREF_KEY, "Toggle", tr("Single deck mode - Toggle vinyl control to next deck"), vinylControlMenu);

    // Cues
    QMenu* cueMenu = addSubmenu(tr("Cues"));
    addDeckControl("cue_default", tr("Cue button"), cueMenu);
    addDeckControl("cue_set", tr("Set cue point"), cueMenu);
    addDeckControl("cue_gotoandstop", tr("Go to cue point and stop"), cueMenu);

    // Hotcues
    QMenu* hotcueMenu = addSubmenu(tr("Hotcues"));
    QString hotcueActivate = tr("Set or jump to hotcue %1");
    QString hotcueClear = tr("Clear hotcue %1");
    QString hotcueGoto = tr("Jump to hotcue %1");
    QString hotcueGotoAndStop = tr("Jump to hotcue %1 and stop");
    for (int i = 1; i <= NUM_HOT_CUES; ++i) {
        QMenu* hotcueSubMenu = addSubmenu(tr("Hotcue %1").arg(QString::number(i)), hotcueMenu);
        addDeckAndSamplerControl(QString("hotcue_%1_activate").arg(i),
                                 hotcueActivate.arg(QString::number(i)), hotcueSubMenu);
        addDeckAndSamplerControl(QString("hotcue_%1_clear").arg(i),
                                 hotcueClear.arg(QString::number(i)), hotcueSubMenu);
        addDeckAndSamplerControl(QString("hotcue_%1_goto").arg(i),
                                 hotcueGoto.arg(QString::number(i)), hotcueSubMenu);
        addDeckAndSamplerControl(QString("hotcue_%1_gotoandstop").arg(i),
                                 hotcueGotoAndStop.arg(QString::number(i)), hotcueSubMenu);
    }

    // Loops
    QMenu* loopMenu = addSubmenu(tr("Looping"));
    addDeckControl("loop_in", tr("Loop In button"), loopMenu);
    addDeckControl("loop_out", tr("Loop Out button"), loopMenu);
    addDeckControl("loop_exit", tr("Loop Exit button"), loopMenu);
    addDeckControl("reloop_exit", tr("Reloop / Exit button"), loopMenu);
    addDeckControl("loop_halve", tr("Halve the current loop's length"), loopMenu);
    addDeckControl("loop_double", tr("Double the current loop's length"), loopMenu);

    // Loop moving
    QString loopMoveForward = tr("Move loop forward by %1 beats");
    QString loopMoveBackward = tr("Move loop backward by %1 beats");
    addDeckControl("loop_move_0.03125_forward",  loopMoveForward.arg(tr("1/32th")), loopMenu);
    addDeckControl("loop_move_0.0625_forward",  loopMoveForward.arg(tr("1/16th")), loopMenu);
    addDeckControl("loop_move_0.125_forward", loopMoveForward.arg(tr("1/8th")), loopMenu);
    addDeckControl("loop_move_0.25_forward", loopMoveForward.arg(tr("1/4th")), loopMenu);
    addDeckControl("loop_move_0.5_forward", loopMoveForward.arg("1/2"), loopMenu);
    addDeckControl("loop_move_1_forward", loopMoveForward.arg("1"), loopMenu);
    addDeckControl("loop_move_2_forward", loopMoveForward.arg("2"), loopMenu);
    addDeckControl("loop_move_4_forward", loopMoveForward.arg("4"), loopMenu);
    addDeckControl("loop_move_8_forward", loopMoveForward.arg("8"), loopMenu);
    addDeckControl("loop_move_16_forward", loopMoveForward.arg("16"), loopMenu);
    addDeckControl("loop_move_32_forward", loopMoveForward.arg("32"), loopMenu);
    addDeckControl("loop_move_64_forward", loopMoveForward.arg("64"), loopMenu);
    addDeckControl("loop_move_0.03125_backward",  loopMoveBackward.arg(tr("1/32th")), loopMenu);
    addDeckControl("loop_move_0.0625_backward",  loopMoveBackward.arg(tr("1/16th")), loopMenu);
    addDeckControl("loop_move_0.125_backward", loopMoveBackward.arg(tr("1/8th")), loopMenu);
    addDeckControl("loop_move_0.25_backward", loopMoveBackward.arg(tr("1/4th")), loopMenu);
    addDeckControl("loop_move_0.5_backward", loopMoveBackward.arg("1/2"), loopMenu);
    addDeckControl("loop_move_1_backward", loopMoveBackward.arg("1"), loopMenu);
    addDeckControl("loop_move_2_backward", loopMoveBackward.arg("2"), loopMenu);
    addDeckControl("loop_move_4_backward", loopMoveBackward.arg("4"), loopMenu);
    addDeckControl("loop_move_8_backward", loopMoveBackward.arg("8"), loopMenu);
    addDeckControl("loop_move_16_backward", loopMoveBackward.arg("16"), loopMenu);
    addDeckControl("loop_move_32_backward", loopMoveBackward.arg("32"), loopMenu);
    addDeckControl("loop_move_64_backward", loopMoveBackward.arg("64"), loopMenu);

    // Beatloops
    QMenu* beatLoopMenu = addSubmenu(tr("Beat-Looping"));
    QString beatLoop = tr("Create %1-beat loop");
    QString beatLoopRoll = tr("Create temporary %1-beat loop roll");
    addDeckControl("beatloop_0.03125_toggle",  beatLoop.arg(tr("1/32th")), beatLoopMenu);
    addDeckControl("beatloop_0.0625_toggle",  beatLoop.arg(tr("1/16th")), beatLoopMenu);
    addDeckControl("beatloop_0.125_toggle", beatLoop.arg(tr("1/8th")), beatLoopMenu);
    addDeckControl("beatloop_0.25_toggle", beatLoop.arg(tr("1/4th")), beatLoopMenu);
    addDeckControl("beatloop_0.5_toggle", beatLoop.arg("1/2"), beatLoopMenu);
    addDeckControl("beatloop_1_toggle", beatLoop.arg("1"), beatLoopMenu);
    addDeckControl("beatloop_2_toggle", beatLoop.arg("2"), beatLoopMenu);
    addDeckControl("beatloop_4_toggle", beatLoop.arg("4"), beatLoopMenu);
    addDeckControl("beatloop_8_toggle", beatLoop.arg("8"), beatLoopMenu);
    addDeckControl("beatloop_16_toggle", beatLoop.arg("16"), beatLoopMenu);
    addDeckControl("beatloop_32_toggle", beatLoop.arg("32"), beatLoopMenu);
    addDeckControl("beatloop_64_toggle", beatLoop.arg("64"), beatLoopMenu);
    addDeckControl("beatlooproll_0.03125_activate",  beatLoopRoll.arg(tr("1/32th")), beatLoopMenu);
    addDeckControl("beatlooproll_0.0625_activate",  beatLoopRoll.arg(tr("1/16th")), beatLoopMenu);
    addDeckControl("beatlooproll_0.125_activate", beatLoopRoll.arg(tr("1/8th")), beatLoopMenu);
    addDeckControl("beatlooproll_0.25_activate", beatLoopRoll.arg(tr("1/4th")), beatLoopMenu);
    addDeckControl("beatlooproll_0.5_activate", beatLoopRoll.arg("1/2"), beatLoopMenu);
    addDeckControl("beatlooproll_1_activate", beatLoopRoll.arg("1"), beatLoopMenu);
    addDeckControl("beatlooproll_2_activate", beatLoopRoll.arg("2"), beatLoopMenu);
    addDeckControl("beatlooproll_4_activate", beatLoopRoll.arg("4"), beatLoopMenu);
    addDeckControl("beatlooproll_8_activate", beatLoopRoll.arg("8"), beatLoopMenu);
    addDeckControl("beatlooproll_16_activate", beatLoopRoll.arg("16"), beatLoopMenu);
    addDeckControl("beatlooproll_32_activate", beatLoopRoll.arg("32"), beatLoopMenu);
    addDeckControl("beatlooproll_64_activate", beatLoopRoll.arg("64"), beatLoopMenu);

    // Beat jumping
    QMenu* beatJumpMenu = addSubmenu(tr("Beat-Jump"));
    QString beatJumpForward = tr("Jump forward by %1 beats");
    QString beatJumpBackward = tr("Jump backward by %1 beats");
    addDeckControl("beatjump_0.03125_forward",  beatJumpForward.arg(tr("1/32th")), beatJumpMenu);
    addDeckControl("beatjump_0.0625_forward",  beatJumpForward.arg(tr("1/16th")), beatJumpMenu);
    addDeckControl("beatjump_0.125_forward", beatJumpForward.arg(tr("1/8th")), beatJumpMenu);
    addDeckControl("beatjump_0.25_forward", beatJumpForward.arg(tr("1/4th")), beatJumpMenu);
    addDeckControl("beatjump_0.5_forward", beatJumpForward.arg("1/2"), beatJumpMenu);
    addDeckControl("beatjump_1_forward", beatJumpForward.arg("1"), beatJumpMenu);
    addDeckControl("beatjump_2_forward", beatJumpForward.arg("2"), beatJumpMenu);
    addDeckControl("beatjump_4_forward", beatJumpForward.arg("4"), beatJumpMenu);
    addDeckControl("beatjump_8_forward", beatJumpForward.arg("8"), beatJumpMenu);
    addDeckControl("beatjump_16_forward", beatJumpForward.arg("16"), beatJumpMenu);
    addDeckControl("beatjump_32_forward", beatJumpForward.arg("32"), beatJumpMenu);
    addDeckControl("beatjump_64_forward", beatJumpForward.arg("64"), beatJumpMenu);
    addDeckControl("beatjump_0.03125_backward",  beatJumpBackward.arg(tr("1/32th")), beatJumpMenu);
    addDeckControl("beatjump_0.0625_backward",  beatJumpBackward.arg(tr("1/16th")), beatJumpMenu);
    addDeckControl("beatjump_0.125_backward", beatJumpBackward.arg(tr("1/8th")), beatJumpMenu);
    addDeckControl("beatjump_0.25_backward", beatJumpBackward.arg(tr("1/4th")), beatJumpMenu);
    addDeckControl("beatjump_0.5_backward", beatJumpBackward.arg("1/2"), beatJumpMenu);
    addDeckControl("beatjump_1_backward", beatJumpBackward.arg("1"), beatJumpMenu);
    addDeckControl("beatjump_2_backward", beatJumpBackward.arg("2"), beatJumpMenu);
    addDeckControl("beatjump_4_backward", beatJumpBackward.arg("4"), beatJumpMenu);
    addDeckControl("beatjump_8_backward", beatJumpBackward.arg("8"), beatJumpMenu);
    addDeckControl("beatjump_16_backward", beatJumpBackward.arg("16"), beatJumpMenu);
    addDeckControl("beatjump_32_backward", beatJumpBackward.arg("32"), beatJumpMenu);
    addDeckControl("beatjump_64_backward", beatJumpBackward.arg("64"), beatJumpMenu);

    // Library Controls
    QMenu* libraryMenu = addSubmenu(tr("Library"));
    addControl("[Playlist]", "ToggleSelectedSidebarItem", tr("Expand/collapse the selected view (library, playlist..)"),
               libraryMenu);
    addControl("[Playlist]", "SelectPlaylist", tr("Switch to the next or previous view (library, playlist..)"),
               libraryMenu);
    addControl("[Playlist]", "SelectNextPlaylist", tr("Switch to the next view (library, playlist..)"),
               libraryMenu);
    addControl("[Playlist]", "SelectPrevPlaylist", tr("Switch to the previous view (library, playlist..)"),
               libraryMenu);
    addControl("[Playlist]", "SelectTrackKnob", tr("Scroll up or down in library/playlist"),
               libraryMenu);
    addControl("[Playlist]", "SelectNextTrack", tr("Scroll to next track in library/playlist"),
               libraryMenu);
    addControl("[Playlist]", "SelectPrevTrack", tr("Scroll to previous track in library/playlist"),
               libraryMenu);
    addControl("[Playlist]", "LoadSelectedIntoFirstStopped", tr("Load selected track into first stopped deck"),
               libraryMenu);
    addDeckAndSamplerControl("LoadSelectedTrack", tr("Load selected track"), libraryMenu);
    addDeckAndSamplerAndPreviewDeckControl("LoadSelectedTrackAndPlay", tr("Load selected track and play"), libraryMenu);

    // Effect Controls
    QMenu* effectsMenu = addSubmenu(tr("Effects"));
    addDeckControl("flanger", tr("Toggle flange effect"), effectsMenu);
    addControl("[Flanger]", "lfoPeriod", tr("Flange effect: Wavelength/period"), effectsMenu, true);
    addControl("[Flanger]", "lfoDepth", tr("Flange effect: Intensity"), effectsMenu, true);
    addControl("[Flanger]", "lfoDelay", tr("Flange effect: Phase delay"), effectsMenu, true);
    addDeckControl("filter", tr("Toggle filter effect"), effectsMenu);
    addDeckControl("filterDepth", tr("Filter effect: Intensity"), effectsMenu, true);

    // Microphone Controls
    QMenu* microphoneMenu = addSubmenu(tr("Microphone"));
    addControl("[Microphone]", "talkover", tr("Microphone on/off"), microphoneMenu);
    addControl("[Microphone]", "volume", tr("Microphone volume"), microphoneMenu, true);
    addControl("[Microphone]", "orientation", tr("Microphone channel orientation (e.g. left, right, center)"), microphoneMenu);

    // AutoDJ Controls
    QMenu* autodjMenu = addSubmenu(tr("Auto DJ"));
    addControl("[AutoDJ]", "shuffle_playlist", tr("Shuffle the content of the Auto DJ playlist"), autodjMenu);
    addControl("[AutoDJ]", "skip_next", tr("Skip the next track in the Auto DJ playlist"), autodjMenu);
    addControl("[AutoDJ]", "fade_now", tr("Trigger the transition to the next track"), autodjMenu);
    addControl("[AutoDJ]", "enabled", tr("Toggle Auto DJ (ON/OFF)"), autodjMenu);

    // Skin Controls
    QMenu* guiMenu = addSubmenu(tr("User Interface"));
    addControl("[Samplers]", "show_samplers", tr("Show/hide the sampler section"), guiMenu);
    addControl("[Microphone]", "show_microphone", tr("Show/hide the microphone section"), guiMenu);
    addControl("[Vinylcontrol]", "show_vinylcontrol", tr("Show/hide the vinyl control section"), guiMenu);
    addControl("[PreviewDeck]", "show_previewdeck", tr("Show/hide the preview deck"), guiMenu);

    const int iNumDecks = ControlObject::get(ConfigKey("[Master]", "num_decks"));
    QString spinnyText = tr("Show/hide spinning vinyl widget");
    for (int i = 1; i <= iNumDecks; ++i) {
        addControl(QString("[Spinny%1]").arg(i), "show_spinny",
                   QString("%1: %2").arg(m_deckStr.arg(i), spinnyText), guiMenu);

    }

    emit(listenForClicks());
    labelMappedTo->setText("");
    labelNextHelp->hide();
    controlToMapMessage->setText("");
    stackedWidget->setCurrentIndex(0);
    m_currentControl = MixxxControl();

    // Wait 1 second until we detect the control the user moved.
    m_lastMessageTimer.setInterval(1000);
    m_lastMessageTimer.setSingleShot(true);
    connect(&m_lastMessageTimer, SIGNAL(timeout()),
            this, SLOT(slotTimerExpired()));
}
Esempio n. 5
0
KRegExpEditorPrivate::KRegExpEditorPrivate(TQWidget *parent, const char *name)
    : TQWidget(parent, name), _updating( false ), _autoVerify( true )
{
  setMinimumSize(730,300);
  TQDockArea* area = new TQDockArea(Qt::Horizontal, TQDockArea::Normal, this );
  area->setMinimumSize(2,2);
  TQDockArea* verArea1 = new TQDockArea(Qt::Vertical, TQDockArea::Normal, this );
  verArea1->setMinimumSize(2,2);
  TQDockArea* verArea2 = new TQDockArea(Qt::Vertical, TQDockArea::Reverse, this );
  verArea2->setMinimumSize(2,2);

  // The DockWindows.
  _regExpButtons = new RegExpButtons( area, "KRegExpEditorPrivate::regExpButton" );
  _verifyButtons = new VerifyButtons( area, "KRegExpEditorPrivate::VerifyButtons" );
  _auxButtons = new AuxButtons( area, "KRegExpEditorPrivate::AuxButtons" );
  _userRegExps = new UserDefinedRegExps( verArea1, "KRegExpEditorPrivate::userRegExps" );
  _userRegExps->setResizeEnabled( true );
  TQWhatsThis::add( _userRegExps, i18n( "In this window you will find predefined regular expressions. Both regular expressions "
                                       "you have developed and saved, and regular expressions shipped with the system." ));

  // Editor window
  _editor = new TQSplitter(Qt::Vertical, this, "KRegExpEditorPrivate::_editor" );

  _scrolledEditorWindow =
    new RegExpScrolledEditorWindow( _editor, "KRegExpEditorPrivate::_scrolledEditorWindow" );
  TQWhatsThis::add( _scrolledEditorWindow, i18n( "In this window you will develop your regular expressions. "
                                               "Select one of the actions from the action buttons above, and click the mouse in this "
                                               "window to insert the given action."));

  _info = new InfoPage( this, "_info" );
  _verifier = new Verifier( _editor, "KRegExpEditorPrivate::_verifier" );
  connect( _verifier, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( maybeVerify() ) );
  TQWhatsThis::add( _verifier, i18n("Type in some text in this window, and see what the regular expression you have developed matches.<p>"
                                   "Each second match will be colored in red and each other match will be colored blue, simply so you "
                                   "can distinguish them from each other.<p>"
                                   "If you select part of the regular expression in the editor window, then this part will be "
                                   "highlighted - This allows you to <i>debug</i> your regular expressions") );

  _editor->hide();
  _editor->setSizes( TQValueList<int>() << _editor->height()/2 << _editor->height()/2 );

  TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, 6, "KRegExpEditorPrivate::topLayout" );
  topLayout->addWidget( area );
  TQHBoxLayout* rows = new TQHBoxLayout; // I need to cal addLayout explicit to get stretching right.
  topLayout->addLayout( rows, 1 );

  rows->addWidget( verArea1 );
  rows->addWidget( _editor, 1 );
  rows->addWidget( _info, 1 );
  rows->addWidget( verArea2 );

  // Connect the buttons
  connect( _regExpButtons, TQT_SIGNAL( clicked( int ) ),   _scrolledEditorWindow, TQT_SLOT( slotInsertRegExp( int ) ) );
  connect( _regExpButtons, TQT_SIGNAL( doSelect() ), _scrolledEditorWindow, TQT_SLOT( slotDoSelect() ) );
  connect( _userRegExps, TQT_SIGNAL( load( RegExp* ) ),    _scrolledEditorWindow, TQT_SLOT( slotInsertRegExp( RegExp*  ) ) );

  connect( _regExpButtons, TQT_SIGNAL( clicked( int ) ), _userRegExps,   TQT_SLOT( slotUnSelect() ) );
  connect( _regExpButtons, TQT_SIGNAL( doSelect() ),     _userRegExps,   TQT_SLOT( slotUnSelect() ) );
  connect( _userRegExps, TQT_SIGNAL( load( RegExp* ) ),  _regExpButtons, TQT_SLOT( slotUnSelect() ) );

  connect( _scrolledEditorWindow, TQT_SIGNAL( doneEditing() ), _regExpButtons, TQT_SLOT( slotSelectNewAction() ) );
  connect( _scrolledEditorWindow, TQT_SIGNAL( doneEditing() ), _userRegExps, TQT_SLOT( slotSelectNewAction() ) );

  connect( _regExpButtons, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( slotShowEditor() ) );
  connect( _userRegExps, TQT_SIGNAL( load( RegExp* ) ), this, TQT_SLOT( slotShowEditor() ) );
  connect( _regExpButtons, TQT_SIGNAL( doSelect() ), this, TQT_SLOT( slotShowEditor() ) );

  connect( _scrolledEditorWindow, TQT_SIGNAL( savedRegexp() ), _userRegExps, TQT_SLOT( slotPopulateUserRegexps() ) );

  connect( _auxButtons, TQT_SIGNAL( undo() ), this, TQT_SLOT( slotUndo() ) );
  connect( _auxButtons, TQT_SIGNAL( redo() ), this, TQT_SLOT( slotRedo() ) );
  connect( _auxButtons, TQT_SIGNAL( cut() ), _scrolledEditorWindow, TQT_SLOT( slotCut() ) );
  connect( _auxButtons, TQT_SIGNAL( copy() ), _scrolledEditorWindow, TQT_SLOT( slotCopy() ) );
  connect( _auxButtons, TQT_SIGNAL( paste() ), _scrolledEditorWindow, TQT_SLOT( slotPaste() ) );
  connect( _auxButtons, TQT_SIGNAL( save() ), _scrolledEditorWindow, TQT_SLOT( slotSave() ) );
  connect( _verifyButtons, TQT_SIGNAL( autoVerify( bool ) ), this, TQT_SLOT( setAutoVerify( bool ) ) );
  connect( _verifyButtons, TQT_SIGNAL( verify() ), this, TQT_SLOT( doVerify() ) );
  connect( _verifyButtons, TQT_SIGNAL( changeSyntax( const TQString& ) ), this, TQT_SLOT( setSyntax( const TQString& ) ) );

  connect( this, TQT_SIGNAL( canUndo( bool ) ), _auxButtons, TQT_SLOT( slotCanUndo( bool ) ) );
  connect( this, TQT_SIGNAL( canRedo( bool ) ), _auxButtons, TQT_SLOT( slotCanRedo( bool ) ) );
  connect( _scrolledEditorWindow, TQT_SIGNAL( anythingSelected( bool ) ), _auxButtons, TQT_SLOT( slotCanCut( bool ) ) );
  connect( _scrolledEditorWindow, TQT_SIGNAL( anythingSelected( bool ) ), _auxButtons, TQT_SLOT( slotCanCopy( bool ) ) );
  connect( _scrolledEditorWindow, TQT_SIGNAL( anythingOnClipboard( bool ) ), _auxButtons, TQT_SLOT( slotCanPaste( bool ) ) );
  connect( _scrolledEditorWindow, TQT_SIGNAL( canSave( bool ) ), _auxButtons, TQT_SLOT( slotCanSave( bool ) ) );

  connect( _scrolledEditorWindow, TQT_SIGNAL( verifyRegExp() ), this, TQT_SLOT( maybeVerify() ) );

  connect( _verifyButtons, TQT_SIGNAL( loadVerifyText( const TQString& ) ), this, TQT_SLOT( setVerifyText( const TQString& ) ) );

  // connect( _verifier, TQT_SIGNAL( countChanged( int ) ), _verifyButtons, TQT_SLOT( setMatchCount( int ) ) );

  // TQt anchors do not work for <pre>...</pre>, thefore scrolling to next/prev match
  // do not work. Enable this when they work.
  // connect( _verifyButtons, TQT_SIGNAL( gotoFirst() ), _verifier, TQT_SLOT( gotoFirst() ) );
  // connect( _verifyButtons, TQT_SIGNAL( gotoPrev() ), _verifier, TQT_SLOT( gotoPrev() ) );
  // connect( _verifyButtons, TQT_SIGNAL( gotoNext() ), _verifier, TQT_SLOT( gotoNext() ) );
  // connect( _verifyButtons, TQT_SIGNAL( gotoLast() ), _verifier, TQT_SLOT( gotoLast() ) );
  // connect( _verifier, TQT_SIGNAL( goForwardPossible( bool ) ), _verifyButtons, TQT_SLOT( enableForwardButtons( bool ) ) );
  // connect( _verifier, TQT_SIGNAL( goBackwardPossible( bool ) ), _verifyButtons, TQT_SLOT( enableBackwardButtons( bool ) ) );

  _auxButtons->slotCanPaste( false );
  _auxButtons->slotCanCut( false );
  _auxButtons->slotCanCopy( false );
  _auxButtons->slotCanSave( false );


  // Line Edit
  TQHBoxLayout* layout = new TQHBoxLayout( topLayout, 6 );
  TQLabel* label = new TQLabel( i18n("ASCII syntax:"), this );
  layout->addWidget( label );
  clearButton = new TQToolButton( this );
  const TQString icon( TQString::fromLatin1( TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase" ) );
  TQIconSet clearIcon = SmallIconSet( icon );
  clearButton->setIconSet( clearIcon );
  layout->addWidget( clearButton );
  TQToolTip::add( clearButton, i18n("Clear expression") );
  _regexpEdit = new TQLineEdit( this );
  layout->addWidget( _regexpEdit );
  TQWhatsThis::add( _regexpEdit, i18n( "This is the regular expression in ASCII syntax. You are likely only "
				      "to be interested in this if you are a programmer, and need to "
				      "develop a regular expression using TQRegExp.<p>"
                                      "You may develop your regular expression both by using the graphical "
				      "editor, and by typing the regular expression in this line edit.") );

#ifdef TQT_ONLY
  TQPixmap pix( "icons/error.png" );
#else
  TQPixmap pix = TDEGlobal::iconLoader()->loadIcon(locate("data", TQString::fromLatin1("kregexpeditor/pics/error.png") ), TDEIcon::Toolbar );
#endif
  _error = new TQLabel( this );
  _error->setPixmap( pix );
  layout->addWidget( _error );
  _error->hide();

  _timer = new TQTimer(this);

  connect( _scrolledEditorWindow, TQT_SIGNAL( change() ), this, TQT_SLOT( slotUpdateLineEdit() ) );
  connect( _regexpEdit, TQT_SIGNAL(textChanged( const TQString& ) ), this, TQT_SLOT( slotTriggerUpdate() ) );
  connect( _timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTimeout() ) );
  connect( clearButton, TQT_SIGNAL( clicked() ), _regexpEdit, TQT_SLOT( clear() ) );

  // Push an initial empty element on the stack.
  _undoStack.push( _scrolledEditorWindow->regExp() );
  _redoStack.setAutoDelete( true );

  TQAccel* accel = new TQAccel( this );
  accel->connectItem( accel->insertItem( CTRL+Key_Z ), this, TQT_SLOT( slotUndo() ) );
  accel->connectItem( accel->insertItem( CTRL+Key_R ), this, TQT_SLOT( slotRedo() ) );

  setSyntax( TQString::fromLatin1( "TQt" ) );
}