Commit 622c2395 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Add support for more image types.

	* lazzara/afp/photos/gui/src/main_window.cc,
	* lazzara/afp/photos/gui/src/main_window.hh: Add support for more
	image format and handle directories with no image.
parent 752d8cae
2010-03-29 Guillaume Lazzara <z@lrde.epita.fr>
Add support for more image types.
* lazzara/afp/photos/gui/src/main_window.cc,
* lazzara/afp/photos/gui/src/main_window.hh: Add support for more
image format and handle directories with no image.
2010-03-19 Guillaume Lazzara <z@lrde.epita.fr>
Improve options menu and progress dialog.
......
......@@ -46,7 +46,12 @@ namespace mln
// Setup directory listing
QStringList filters;
filters << "*.ppm";
filters << "*.ppm"
<< "*.pgm"
<< "*.pbm"
<< "*.jpg"
<< "*.png"
<< "*.tiff";
dir_.setNameFilters(filters);
dir_.setFilter(QDir::Files);
dir_.setSorting(QDir::Name);
......@@ -113,7 +118,7 @@ namespace mln
}
main_window::~main_window()
{
{
if (process_.state() == QProcess::Running)
{
process_.disconnect();
......@@ -147,7 +152,14 @@ namespace mln
progressBar_.setValue(0);
options_ = options;
start_process();
if (current_file_ < file_list_.size())
start_process();
else
{
QMessageBox::critical(this, "No image found!", QString("This application could not find any supported images in the provided directory. Supported file types are: %1").arg(dir_.nameFilters().join(" ")));
stop_process();
}
}
void
......@@ -166,10 +178,7 @@ namespace mln
if (current_file_ < file_list_.size())
start_process();
else
{
progressToolBar_->hide();
emit process_finished();
}
stop_process();
}
......@@ -210,6 +219,13 @@ namespace mln
process_.start(text_in_photo_ppm_, args);
}
void
main_window::stop_process()
{
progressToolBar_->hide();
emit process_finished();
}
void
main_window::process__error_slot(QProcess::ProcessError)
{
......
......@@ -77,6 +77,7 @@ namespace mln
void display_image(const QString& filename);
void start_process();
void stop_process();
void next_process();
void connect_process();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment