Ejemplo n.º 1
0
void MainWindow::newFile()
{
    if (okToContinue()) {
        spreadsheet->clear();
        setCurrentFile("");
    }
}
Ejemplo n.º 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;
			}
		}
	}
}
Ejemplo n.º 3
0
void chanEditorWidget::closeEvent(QCloseEvent* event){
	if (okToContinue()){
		event->accept();
	}

	else event->ignore();
}
Ejemplo n.º 4
0
/*!

*/
void Monofin::closeEvent(QCloseEvent *closeEvent)
{
    if (okToContinue())
        closeEvent->accept();
    else
        closeEvent->ignore();
}
Ejemplo n.º 5
0
void MainWindow::dropEvent(QDropEvent* event)
{
	auto path = event->mimeData()->urls().first().toLocalFile();
	event->acceptProposedAction();
	if (!path.isEmpty() && okToContinue())
		loadFile(path);
}
Ejemplo n.º 6
0
//*****************************************************************************
void mlMainWindow::newFile() {
    //-------------------------------------------------------------------------
    if( okToContinue() ) {
        ui->tbxEditor->clear();
        setCurrentFile("");
    }
}
Ejemplo n.º 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();
    }
}
Ejemplo n.º 10
0
void MainWindow::newFile()
{
    if(okToContinue() && resize())
    {
        painter->clear();
        setCurrentFile("");
    }
}
Ejemplo n.º 11
0
void MainWindow::newFile()
{
	if(okToContinue())
	{
	//	widget->clear();
		setCurrentFile("");
	}
}
Ejemplo n.º 12
0
void MainWindow::openRecentFile()
{
    if (okToContinue()) {
        QAction *action = qobject_cast<QAction *>(sender());
        if (action)
            loadFile(action->data().toString());
    }
}
Ejemplo n.º 13
0
void MainWindow::closeEvent(QCloseEvent *event)
{
    if(okToContinue())
    {
        writeSettings();
        event->accept();
    }
    else event->ignore();
}
Ejemplo n.º 14
0
void MainWindow::open()
{
	if(okToContinue())
	{
		QString fileName = QFileDialog::getOpenFileName(this,tr("Open Spreadsheet"),".",tr("spreadsheet files(*.sp)"));
		if(!fileName.isEmpty())
			loadFile(fileName);
	}
}
Ejemplo n.º 15
0
void Sudoku::selectAGame() {
	if (okToContinue()) {
		SelectDialog dialog(this);
		if (dialog.exec()) {
			QString num = dialog.lineEdit->text();
			loadGame(num);
		}
	}
}
Ejemplo n.º 16
0
void Sudoku::createAGame() {
	if (okToContinue()) {
		board->clear();
		clearWindow();
		creationMode = true;
		setWindowTitle(tr("Sudoku - Creation Mode"));
		setWindowModified(false);
	}
}
Ejemplo n.º 17
0
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);
	}
}
Ejemplo n.º 18
0
void MainWindow::open()
{
	if(okToContinue())
	{
		QString fileName = QFileDialog::getOpenFileName(this, tr("Dialog …fnnen"), ".", tr("Dialog (*.dialog)"));
		
		if(!fileName.isEmpty())
			{ loadFile(fileName); }
	}
}
Ejemplo n.º 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);
	}
}
Ejemplo n.º 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);
    }
}
Ejemplo n.º 21
0
void MainWindow::open()
{
      if(okToContinue())
      {
        QString fileName = QFileDialog::getOpenFileName(this,
                                                        tr("Open image"), ".",
                                                        tr("bitmap (*.bmp)"));
        if(!fileName.isEmpty())
            loadFile(fileName);
      }
}
Ejemplo n.º 22
0
/*!
    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;
}
Ejemplo n.º 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;
}
Ejemplo n.º 24
0
void ToolDBManagerGui::closeEvent(QCloseEvent *event)
{
	if (okToContinue())
	{
		writeSettings();
		event->accept();
	}
	else
	{
		event->ignore();
	}
}
Ejemplo n.º 25
0
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());
	    }
	}
}
Ejemplo n.º 26
0
/** 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);
    }
}
Ejemplo n.º 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";

}
Ejemplo n.º 28
0
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());
			}
		}
	}
}
Ejemplo n.º 29
0
void Sudoku::newGame() {
	if (okToContinue()) {
		int randomGame = e() % gameCount + 1;
		loadGame(QString::number(randomGame));
	}
}