void MainWindow::newFile()
{
    if (okToContinue()) {
        spreadsheet->clear();
        setCurrentFile("");
    }
}
Exemple #2
0
void MainWindow::open()
{
	if(okToContinue())
	{
		// lets get a folder name from the dialog
		QString folderName = QFileDialog::getExistingDirectory(
				this,
				"Select the directory with all the DICOMS in it",
				"/home/oferoze/data",
				QFileDialog::ShowDirsOnly);


		// if we have good directory, lets load up the dicom browser
		if(!folderName.isEmpty())
		{
			browser = new DICOMBrowser(folderName, true, this);
			if(browser->setUp())
			{
				//connect the browser
				connect(browser, SIGNAL(okButtonSignal(FilenamesType)), this, SLOT(getFilenamesFromBrowser(FilenamesType)));
				browser->show();

			}
			else
			{
				std::cout << "Error in the browser, maybe you should, choose a new folder...?" << std::endl;
			}
		}
	}
}
void chanEditorWidget::closeEvent(QCloseEvent* event){
	if (okToContinue()){
		event->accept();
	}

	else event->ignore();
}
/*!

*/
void Monofin::closeEvent(QCloseEvent *closeEvent)
{
    if (okToContinue())
        closeEvent->accept();
    else
        closeEvent->ignore();
}
Exemple #5
0
void MainWindow::dropEvent(QDropEvent* event)
{
	auto path = event->mimeData()->urls().first().toLocalFile();
	event->acceptProposedAction();
	if (!path.isEmpty() && okToContinue())
		loadFile(path);
}
Exemple #6
0
//*****************************************************************************
void mlMainWindow::newFile() {
    //-------------------------------------------------------------------------
    if( okToContinue() ) {
        ui->tbxEditor->clear();
        setCurrentFile("");
    }
}
Exemple #7
0
void Sudoku::closeEvent(QCloseEvent *event) {
	if (okToContinue()) {
		writeSettings();
		event->accept();
	} else {
		event->ignore();
	}
}
void ImageWindow::open()
{
    if (okToContinue()) {
        QString fileName = QFileDialog::getOpenFileName(this);
        if (!fileName.isEmpty())
            loadFile(fileName);
    }
}
void ImageWindow::closeEvent(QCloseEvent *event)
{
    if (okToContinue()) {
        event->accept();
    } else {
        event->ignore();
    }
}
void MainWindow::newFile()
{
    if(okToContinue() && resize())
    {
        painter->clear();
        setCurrentFile("");
    }
}
void MainWindow::newFile()
{
	if(okToContinue())
	{
	//	widget->clear();
		setCurrentFile("");
	}
}
void MainWindow::openRecentFile()
{
    if (okToContinue()) {
        QAction *action = qobject_cast<QAction *>(sender());
        if (action)
            loadFile(action->data().toString());
    }
}
void MainWindow::closeEvent(QCloseEvent *event)
{
    if(okToContinue())
    {
        writeSettings();
        event->accept();
    }
    else event->ignore();
}
Exemple #14
0
void MainWindow::open()
{
	if(okToContinue())
	{
		QString fileName = QFileDialog::getOpenFileName(this,tr("Open Spreadsheet"),".",tr("spreadsheet files(*.sp)"));
		if(!fileName.isEmpty())
			loadFile(fileName);
	}
}
Exemple #15
0
void Sudoku::selectAGame() {
	if (okToContinue()) {
		SelectDialog dialog(this);
		if (dialog.exec()) {
			QString num = dialog.lineEdit->text();
			loadGame(num);
		}
	}
}
Exemple #16
0
void Sudoku::createAGame() {
	if (okToContinue()) {
		board->clear();
		clearWindow();
		creationMode = true;
		setWindowTitle(tr("Sudoku - Creation Mode"));
		setWindowModified(false);
	}
}
void MainWindow::closeEvent(QCloseEvent *e)
{
	if (okToContinue()) {
        qDebug() << "closing";
        m_settings.setValue("mainwindow/geometry", saveGeometry());
        m_settings.setValue("mainwindow/windowState", saveState());
				logBrowser->close();
	    QMainWindow::closeEvent(e);
	}
}
void MainWindow::open()
{
	if(okToContinue())
	{
		QString fileName = QFileDialog::getOpenFileName(this, tr("Dialog …fnnen"), ".", tr("Dialog (*.dialog)"));
		
		if(!fileName.isEmpty())
			{ loadFile(fileName); }
	}
}
Exemple #19
0
void MainWindow::open()
{
	if (okToContinue()) {
		auto filters = DocumentFactory::instance().loadFilesFilter();
		QString fileName = QFileDialog::getOpenFileName(this,
								   tr("Open Document"), ".",
								   QString::fromStdString(filters));
		if (!fileName.isEmpty())
			loadFile(fileName);
	}
}
Exemple #20
0
//*****************************************************************************
void mlMainWindow::open() {
    //-------------------------------------------------------------------------
    if( okToContinue() ) {
        QString fileName = QFileDialog::getOpenFileName(this,
                            tr("%1 - Open a file").arg(sAPPNAME),
                            ".",
                            "Text files (*.txt);;All files (*.*)" );
        if (!fileName.isEmpty())
            loadFile(fileName);
    }
}
void MainWindow::open()
{
      if(okToContinue())
      {
        QString fileName = QFileDialog::getOpenFileName(this,
                                                        tr("Open image"), ".",
                                                        tr("bitmap (*.bmp)"));
        if(!fileName.isEmpty())
            loadFile(fileName);
      }
}
/*!
    Ask the user to open a file, using a QFileDialog.
    \sa QFileDialog
*/
bool Monofin::open()
{
    qDebug("Monofin::open()");
    if (okToContinue()) {
        QString fileName = QFileDialog::getOpenFileName(this,
                                                        tr("Open Monofin"), ".",
                                                        tr("Monofin files (*.fin)"));
        if (!fileName.isEmpty())
            return openFile(fileName);
    }
    return false;
}
Exemple #23
0
bool MainWindow::openFile()
{
    if(okToContinue()) {
        QString fileName = QFileDialog::
                           getOpenFileName(this, tr("QSpreadsheet"), ".",
                                           tr("QSpreadsheet files (*.qsp)"));
        if(!fileName.isEmpty()) {
            return loadFile(fileName);
        }
    }
    return false;
}
void ToolDBManagerGui::closeEvent(QCloseEvent *event)
{
	if (okToContinue())
	{
		writeSettings();
		event->accept();
	}
	else
	{
		event->ignore();
	}
}
void MainWindow::slotLoadProjectDialog()
{
	if (okToContinue()) {
	    QString dir = m_settings.value("directories/lastOpenedProject", QDir::current().absolutePath()).toString();
    	QString file = QFileDialog::getOpenFileName(this, tr("Load Project"), dir, tr("slowmoVideo projects (*.sVproj)"));

	    if (!file.isEmpty()) {
    	    qDebug() << file;
        	loadProject(QFileInfo(file).absoluteFilePath());
	    }
	}
}
/** Open Slot
  *
  * Opens a new spreadsheet
  */
void MainWindow::open()
{
    if(okToContinue())
    {
        /* Parameters: Parent, Message to Display,
         * Starting Directory (current), File type filter */
        QString fileName = QFileDialog::getOpenFileName(this,
                                                        tr("Open Spreadsheet"), ".",
                                                        tr("Spreadsheet files (*.sp)"));
        /* If it actually a file name then load */
        if(!fileName.isEmpty())
            loadFile(fileName);
    }
}
Exemple #27
0
void MainWindow::newFile()
{
	if (okToContinue()) 
	{
        //we just create a spreatsheet file.
        Spreadsheet *ss = new Spreadsheet(this);
        int index = tabWidget -> addTab(ss, tr("untitled"));
        documents[index] = ss;
        ss -> clear();
        createContextMenu(ss);
	}
    //std::cout << "create a new window\n";

}
void MainWindow::open()
{
	if(okToContinue())
	{
		// get a list of selected file names
		//
		//
		//
		QStringList fileNames = QFileDialog::getOpenFileNames(
				this, "Select one or more image files files",
				"/home/oferoze/Data");

		// if the return is not empty
		// load up the files
		//
		//
		//
		if(!fileNames.empty())
		{
			for(int i = 0; i < fileNames.size(); i++)
			{
				mitk::DataNodeFactory::Pointer reader = mitk::DataNodeFactory::New();
				reader->SetFileName(fileNames[i].toStdString());

				try
				{
					reader->Update();
				}
				catch(mitk::Exception &e)
				{
					std::cout << "Error reading file!!!!" << std::endl;
					std::cout << e << std::endl;
					return;
				}

				std::cout << reader->GetNumberOfOutputs() << std::endl;

				// add the data into  the storage
				this->addImage(reader->GetOutput());
			}
		}
	}
}
Exemple #29
0
void Sudoku::newGame() {
	if (okToContinue()) {
		int randomGame = e() % gameCount + 1;
		loadGame(QString::number(randomGame));
	}
}