Exemplo n.º 1
0
SoundEditor::SoundEditor (GuiObject parent, const wchar_t *title, Any data)
	: TimeSoundAnalysisEditor (parent, title, data, data, false) {
	createMenus ();
	Melder_assert (data != NULL);
	//try { // FIXME exception
		/*
		 * _longSound.data or _sound.data have to be set before we call FunctionEditor_init,
		 * because createMenus expect that one of them is not NULL.
		 */
		if (_longSound.data && _endWindow - _startWindow > 30.0) {
			_endWindow = _startWindow + 30.0;
			if (_startWindow == _tmin)
				_startSelection = _endSelection = 0.5 * (_startWindow + _endWindow);
			marksChanged ();
		}
	/*} catch (...) {
		rethrowmzero ("Sound window not created.");
	}*/
}
Exemplo n.º 2
0
void EditorTabWidget::createDocument(KURL url/*, const QString& text*/)
{
  /*
    KTextEditor::PopupMenuInterface* popupIf = dynamic_cast<KTextEditor::PopupMenuInterface*>(w->view());
    if (popupIf)
       popupIf->installPopup((QPopupMenu *)quantaApp->factory()->container("popup_editor", quantaApp));
  */

  KTextEditor::View *view;
  if((view = openKDocument(url)) == NULL) return;


  KTextEditor::MarkInterfaceExtension* imarkex =
    dynamic_cast<KTextEditor::MarkInterfaceExtension*>(view->document());

  if(imarkex) {
    KIconLoader *loader = KGlobal::iconLoader();

    #if (KDE_VERSION_MAJOR >= 3) &&  (KDE_VERSION_MINOR >= 3)
    imarkex->setPixmap(KTextEditor::MarkInterface::Execution, loader->loadIcon(
                         "executionpoint", KIcon::Small));
    #else
    imarkex->setPixmap(KTextEditor::MarkInterface::markType05, loader->loadIcon(
                         "executionpoint", KIcon::Small));
    #endif

    imarkex->setPixmap(KTextEditor::MarkInterface::markType08, loader->loadIcon(
                         "preexecutionpoint", KIcon::Small));

    #if (KDE_VERSION_MAJOR >= 3) &&  (KDE_VERSION_MINOR >= 3)
    imarkex->setPixmap(KTextEditor::MarkInterface::BreakpointActive, loader->loadIcon(
                         "activebreakpoint",KIcon::Small));
    #else
    imarkex->setPixmap(KTextEditor::MarkInterface::markType02, loader->loadIcon(
                         "activebreakpoint", KIcon::Small));
    #endif

    #if (KDE_VERSION_MAJOR >= 3) &&  (KDE_VERSION_MINOR >= 3)
    imarkex->setPixmap(KTextEditor::MarkInterface::BreakpointDisabled, loader->loadIcon(
                         "disabledbreakpoint",KIcon::Small));
    #else
    imarkex->setPixmap(KTextEditor::MarkInterface::markType04, loader->loadIcon(
                         "disabledbreakpoint", KIcon::Small));
    #endif

    #if (KDE_VERSION_MAJOR >= 3) &&  (KDE_VERSION_MINOR >= 3)
    imarkex->setDescription(KTextEditor::MarkInterface::BreakpointActive, "Breakpoint");
    #else
    imarkex->setDescription(KTextEditor::MarkInterface::markType02, "Breakpoint");
    #endif

    #if (KDE_VERSION_MAJOR >= 3) &&  (KDE_VERSION_MINOR >= 3)
    imarkex->setMarksUserChangable(KTextEditor::MarkInterface::Bookmark + KTextEditor::MarkInterface::BreakpointActive);
    #else
    imarkex->setMarksUserChangable(KTextEditor::MarkInterface::markType01 + KTextEditor::MarkInterface::markType02);
    #endif

  }

  connect(view->document(), SIGNAL(marksChanged()), this, SLOT(slotMarkChanged()));

  connect(view->document(), SIGNAL(undoChanged()), this, SLOT(slotUndoChanged()));

  Document_t d;
  d.path = url.path();
  d.view = view;
  d.hasUndo = false;
  d.hasRedo = false;

  //d.marks = imark->marks();
  m_docList.append(d);
  disableUndoAction();
  disableRedoAction();
}