2010-12-09 12:31:50 +00:00
|
|
|
/* This file is (c) 2008-2011 Konstantin Isakov <ikm@goldendict.org>
|
2009-01-28 20:55:45 +00:00
|
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
|
|
|
|
#include "initializing.hh"
|
2009-02-08 20:55:28 +00:00
|
|
|
#include <QCloseEvent>
|
2009-01-28 20:55:45 +00:00
|
|
|
|
2009-03-29 13:34:39 +00:00
|
|
|
Initializing::Initializing( QWidget * parent, bool showOnStartup ): QDialog( parent )
|
2009-01-28 20:55:45 +00:00
|
|
|
{
|
|
|
|
ui.setupUi( this );
|
2009-02-08 21:03:36 +00:00
|
|
|
setWindowFlags( Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
|
|
|
|
Qt::WindowMinimizeButtonHint );
|
2011-08-06 18:39:16 +00:00
|
|
|
|
|
|
|
#ifndef Q_OS_MAC
|
|
|
|
setWindowIcon( QIcon( ":/icons/programicon.png" ) );
|
|
|
|
#else
|
|
|
|
setWindowIcon( QIcon( ":/icons/macicon.png" ) );
|
|
|
|
#endif
|
2009-03-29 13:34:39 +00:00
|
|
|
|
|
|
|
if ( showOnStartup )
|
|
|
|
{
|
|
|
|
ui.operation->setText( tr( "Please wait..." ) );
|
|
|
|
ui.dictionary->hide();
|
|
|
|
ui.progressBar->hide();
|
|
|
|
show();
|
|
|
|
}
|
2009-01-28 20:55:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Initializing::indexing( QString const & dictionaryName )
|
|
|
|
{
|
|
|
|
ui.operation->setText( tr( "Please wait while indexing dictionary" ) );
|
|
|
|
ui.dictionary->setText( dictionaryName );
|
2009-03-29 13:34:39 +00:00
|
|
|
ui.dictionary->show();
|
|
|
|
ui.progressBar->show();
|
2009-01-28 20:55:45 +00:00
|
|
|
show();
|
|
|
|
}
|
2009-02-08 20:55:28 +00:00
|
|
|
|
|
|
|
void Initializing::closeEvent( QCloseEvent * ev )
|
|
|
|
{
|
|
|
|
ev->ignore();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Initializing::reject()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|