slot for pening an image file Definition at line 172 of file aimainwindow.cpp. 00173 { 00174 try 00175 { 00176 //~ test if screen is not empty (no image opened or generated) 00177 if( !m_view->view()->emptyScreen() ) 00178 { 00179 if( QMessageBox::Open != QMessageBox::warning(this, tr("Open...") , tr("The screen is not empty, you want really open another file in this screen ?"), QMessageBox::Open | QMessageBox::Cancel, QMessageBox::Cancel ) ) 00180 { 00181 return; 00182 } 00183 } 00184 00185 //~ open a png image 00186 QString fileName = QFileDialog::getOpenFileName(this, tr("Open Image"), "", tr("Image File (*.png)")); 00187 m_view->view()->makeUpdate( fileName ); 00188 if( !fileName.isNull() && !fileName.isEmpty() ) 00189 { 00190 this->enabledChilds( true ); 00191 } 00192 } 00193 catch(const std::exception & exception ) 00194 { 00195 QMessageBox::critical(this, tr("Critical Error!"), tr("Please report this problem to adrabi[at]gmail[dot]com =).")); 00196 } 00197 } |