Esempio n. 1
0
void  MWindow::closeGraph(){
	#ifdef MYDEBUG
		qDebug()<<"Startuje MWindow::closeGraph()";
	#endif
	if( QMessageBox::question(
				this,
				tr("Potwierdz"),
				tr("Czy na pewno zamknac biezacy graf?\n Wszystkie niezapisane dane zostana utracone."),
				QMessageBox::Yes | QMessageBox::No,
				QMessageBox::No
				) == QMessageBox::Yes
			)
	{
		engine->destroyCurrentGraph();
		#ifdef MYDEBUG
			qDebug()<<"MWindow::closeGraph(): zniszcono biezacy graf";
		#endif
		centralWidgetPtr->closeCurrent();
		#ifdef MYDEBUG
			qDebug()<<"MWindow::closeGraph(): usunieto element z combobox";
		#endif
		if(--opened == 0){
			disableActions();
		}
	}
}
Esempio n. 2
0
void FrostEdit::currentTabPageChanged(int id) {
	if(id == -1) {
		disableActions();
		return;
	}
	QWidget* wid = mCurrentTabWidget->widget(id);
	if(wid == nullptr) {
		disableActions();
		return;
	}
	TextEdit* e = toTextEdit(wid);
	if(e != nullptr &&  e->document() != getActiveDocument())
		emit documentChanged(toDocument(e->document()));
	//if there's no editor, let's disable some buttons.
	if(e == nullptr) {
		disableActions();
	} else { //there was editor, enable them
		enableActions();
	}
}
Esempio n. 3
0
void FrostEdit::setActiveTabWidget(TabWidget* wid) {

	if (!wid) return;

	QWidget* curwid = wid->currentWidget();
	TextEdit* e = toTextEdit(curwid);

	TabWidgetFrame* frame = toTabWidgetFrame(wid->parentWidget());
	FrostDialog* diag =toFrostDialog(frame->parentWidget());
	if(diag == NULL)
		changeTitle(wid, wid->currentIndex());

	if(e == nullptr) {
		disableActions();
	} else {
		enableActions();
	}

}