Commit 968e85ad authored by Jan Möbius's avatar Jan Möbius
Browse files

Added Viewerproperty for snapshot scripting function, Added startup variable

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10409 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 9d7f367f
...@@ -605,6 +605,9 @@ Core::init() { ...@@ -605,6 +605,9 @@ Core::init() {
scenegraphCheckTimer_->start (); scenegraphCheckTimer_->start ();
} }
// System is ready now.
OpenFlipper::Options::finishedStartup();
QTimer::singleShot(100, this, SLOT(slotExecuteAfterStartup())); QTimer::singleShot(100, this, SLOT(slotExecuteAfterStartup()));
} }
...@@ -1203,6 +1206,19 @@ void Core::snapshotBaseFileName(const QString& _fname, unsigned int _viewerId ){ ...@@ -1203,6 +1206,19 @@ void Core::snapshotBaseFileName(const QString& _fname, unsigned int _viewerId ){
} }
void Core::snapshotFileType(const QString& _type, unsigned int _viewerId ){
if ( OpenFlipper::Options::gui() ) {
if ( _viewerId >= OpenFlipper::Options::examinerWidgets() ) {
emit log(LOGERR,tr("Unable to snapshotFileType for viewer ") + QString::number(_viewerId) );
return;
}
PluginFunctions::viewerProperties(_viewerId).snapshotBaseFileName( _type );
}
}
void Core::snapshot( unsigned int _viewerId, int _width, int _height, bool _alpha ){ void Core::snapshot( unsigned int _viewerId, int _width, int _height, bool _alpha ){
...@@ -1328,6 +1344,8 @@ void Core::setDescriptions(){ ...@@ -1328,6 +1344,8 @@ void Core::setDescriptions(){
QStringList(tr("frameRate")), QStringList(tr("Maximum frameRate"))); QStringList(tr("frameRate")), QStringList(tr("Maximum frameRate")));
emit setSlotDescription("snapshotBaseFileName(QString&)", tr("Set a filename for storing snapshots.") emit setSlotDescription("snapshotBaseFileName(QString&)", tr("Set a filename for storing snapshots.")
, QStringList(), QStringList()); , QStringList(), QStringList());
emit setSlotDescription("snapshotFileType(QString&)", tr("Set a filetype for storing snapshots.")
, QStringList(), QStringList());
emit setSlotDescription("snapshot()", tr("Make a snapshot of the viewer. If no filename" emit setSlotDescription("snapshot()", tr("Make a snapshot of the viewer. If no filename"
" was set using snapshotBaseFileName() the snapshot is stored" " was set using snapshotBaseFileName() the snapshot is stored"
" in snap.png in the current directory. The captured image will have " " in snap.png in the current directory. The captured image will have "
......
...@@ -488,6 +488,9 @@ public slots: ...@@ -488,6 +488,9 @@ public slots:
/// set the baseFilename for snapshots (a counter is automatically increased when /// set the baseFilename for snapshots (a counter is automatically increased when
/// snapshot() is called) /// snapshot() is called)
void snapshotBaseFileName(const QString& _fname, unsigned int _viewerId = 0); void snapshotBaseFileName(const QString& _fname, unsigned int _viewerId = 0);
/// Set the file type for snapshots.
void snapshotFileType(const QString& _type, unsigned int _viewerId );
/** Trigger a snapshot and increase the snapshot counter. /** Trigger a snapshot and increase the snapshot counter.
Save snapshot to file determined by snapshotBaseFileName() and Save snapshot to file determined by snapshotBaseFileName() and
......
...@@ -122,6 +122,9 @@ static QDir currentScriptDir_; ...@@ -122,6 +122,9 @@ static QDir currentScriptDir_;
/// Current texture directory of the application /// Current texture directory of the application
static QDir currentTextureDir_; static QDir currentTextureDir_;
/// Is system in startup phase
static bool startup_ = false;
/// Should ini-files be deleted on exit? /// Should ini-files be deleted on exit?
static bool deleteIniFile_ = false; static bool deleteIniFile_ = false;
...@@ -315,6 +318,10 @@ QStringList optionFiles() { return optionFiles_; } ...@@ -315,6 +318,10 @@ QStringList optionFiles() { return optionFiles_; }
void optionFiles(QStringList _list) { optionFiles_ = _list; } void optionFiles(QStringList _list) { optionFiles_ = _list; }
bool startup() { return startup_; };
void finishedStartup() { startup_ = false;};
QIcon& OpenFlipperIcon() { QIcon& OpenFlipperIcon() {
if (OpenFlipperIcon_ == 0){ if (OpenFlipperIcon_ == 0){
......
...@@ -271,6 +271,14 @@ QString helpDirStr(); ...@@ -271,6 +271,14 @@ QString helpDirStr();
* @{ */ * @{ */
//=========================================================================== //===========================================================================
/// Returns if the system is currently in a startup phase
DLLEXPORT
bool startup();
/// Set status to startup complete
DLLEXPORT
void finishedStartup();
/// return the current script-directory /// return the current script-directory
DLLEXPORT DLLEXPORT
QString currentScriptDirStr(); QString currentScriptDirStr();
......
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