diff options
author | Michele Calgaro <[email protected]> | 2025-02-10 15:10:13 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2025-02-10 15:10:13 +0900 |
commit | 203fcb8d90752b546c672c625927a136b959fcfb (patch) | |
tree | a899621e4cb63e2cdd9b94f889ee9d0ae8561bf0 /src/ksquirrelpart/sq_glview.cpp | |
parent | 98c274834c63c7fa4a9a494fdf7cd483336714d5 (diff) | |
download | ksquirrel-203fcb8d90752b546c672c625927a136b959fcfb.tar.gz ksquirrel-203fcb8d90752b546c672c625927a136b959fcfb.zip |
Rename 'ksquirrel' folder to 'src'
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'src/ksquirrelpart/sq_glview.cpp')
-rw-r--r-- | src/ksquirrelpart/sq_glview.cpp | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/src/ksquirrelpart/sq_glview.cpp b/src/ksquirrelpart/sq_glview.cpp new file mode 100644 index 0000000..8fb909a --- /dev/null +++ b/src/ksquirrelpart/sq_glview.cpp @@ -0,0 +1,114 @@ +/*************************************************************************** + sq_glview.cpp - description + ------------------- + begin : Thu Nov 29 2007 + copyright : (C) 2007 by Baryshev Dmitry + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include <tdeglobal.h> + +#include "sq_glview.h" + +SQ_GLView * SQ_GLView::m_inst = 0; + +/***************************************/ + +SQ_TextSetter::SQ_TextSetter(TQObject *parent) : TQObject(parent) +{ + dest = "---"; +} + +SQ_TextSetter::~SQ_TextSetter() +{} + +void SQ_TextSetter::setText(const TQString &s) +{ + dest = s; + + emit changed(); +} + +/***************************************/ + +SQ_GLView::SQ_GLView() : TQObject() +{ + m_inst = this; + + map.insert("SBDecoded", new SQ_TextSetter(this)); + map.insert("SBFrame", new SQ_TextSetter(this)); + map.insert("SBLoaded", new SQ_TextSetter(this)); + map.insert("SBGLZoom", new SQ_TextSetter(this)); + map.insert("SBGLAngle", new SQ_TextSetter(this)); + map.insert("SBFile", new SQ_TextSetter(this)); + + tmp = new SQ_TextSetter(this); + + SQ_Setters::iterator itEnd = map.end(); + + for(SQ_Setters::iterator it = map.begin();it != itEnd;++it) + connect(it.data(), TQ_SIGNAL(changed()), this, TQ_SLOT(slotChanged())); +} + +SQ_GLView::~SQ_GLView() +{} + +SQ_TextSetter* SQ_GLView::sbarWidget(const TQString &name) +{ + SQ_Setters::iterator it = map.find(name); + + return (it == map.end() ? tmp : it.data()); +} + +void SQ_GLView::resetStatusBar() +{ + SQ_Setters::iterator itEnd = map.end(); + + for(SQ_Setters::iterator it = map.begin();it != itEnd;++it) + { + it.data()->blockSignals(true); + it.data()->setText("---"); + it.data()->blockSignals(false); + } + + slotChanged(); +} + +void SQ_GLView::slotChanged() +{ + TQString result; + + static const TQString &line = TDEGlobal::staticQString(" | "); + + result.append(map["SBDecoded"]->text()); + result.append(line); + + result.append(map["SBFrame"]->text()); + result.append(line); + + result.append(map["SBLoaded"]->text()); + result.append(line); + + result.append(map["SBGLZoom"]->text()); + result.append(line); + + result.append(map["SBGLAngle"]->text()); + result.append(line); + + result.append("<b>"); + result.append(map["SBFile"]->text()); + result.append("</b>"); + + emit message(result); +} + +#include "sq_glview.moc" |