Commit 3697e25c authored by Sylvain Thery's avatar Sylvain Thery Committed by Pierre Kraemer
Browse files

some improvement in SCHNApps

parent a1a6a383
...@@ -44,8 +44,6 @@ public: ...@@ -44,8 +44,6 @@ public:
bool isChecked(const QString& str); bool isChecked(const QString& str);
virtual QSize sizeHint() const;
}; };
......
...@@ -129,6 +129,8 @@ public: ...@@ -129,6 +129,8 @@ public:
void addMenuAction(Plugin* plugin, const QString& menuPath, QAction* action); void addMenuAction(Plugin* plugin, const QString& menuPath, QAction* action);
void removeMenuAction(Plugin* plugin, QAction* action); void removeMenuAction(Plugin* plugin, QAction* action);
void statusBarMessage(const QString& msg, int msec);
public slots: public slots:
void aboutSCHNApps(); void aboutSCHNApps();
void aboutCGoGN(); void aboutCGoGN();
......
...@@ -12,7 +12,7 @@ ListPopUp::ListPopUp(const QString& name, QWidget* parent) : ...@@ -12,7 +12,7 @@ ListPopUp::ListPopUp(const QString& name, QWidget* parent) :
QDialog(parent) QDialog(parent)
{ {
setWindowTitle(name); setWindowTitle(name);
setWindowFlags(windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint); setWindowFlags(windowFlags()/* | Qt::FramelessWindowHint*/ | Qt::SplashScreen | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint);
m_layout = new QVBoxLayout(this); m_layout = new QVBoxLayout(this);
setLayout(m_layout); setLayout(m_layout);
m_layout->setContentsMargins(1, 1, 1, 1); m_layout->setContentsMargins(1, 1, 1, 1);
...@@ -25,11 +25,6 @@ ListPopUp::~ListPopUp() ...@@ -25,11 +25,6 @@ ListPopUp::~ListPopUp()
{ {
} }
QSize ListPopUp::sizeHint() const
{
return QSize(170,100);
}
QListWidget* ListPopUp::list() QListWidget* ListPopUp::list()
{ {
return m_list_items; return m_list_items;
...@@ -40,7 +35,7 @@ void ListPopUp::show() ...@@ -40,7 +35,7 @@ void ListPopUp::show()
int rows = m_list_items->model()->rowCount(); int rows = m_list_items->model()->rowCount();
int rowSize = m_list_items->sizeHintForRow(0); int rowSize = m_list_items->sizeHintForRow(0);
int height = rows * rowSize + 6; int height = rows * rowSize + 6;
if (height < 96) if (height < 96) // 96??
height = 96; height = 96;
m_list_items->setFixedHeight(height); m_list_items->setFixedHeight(height);
QDialog::show(); QDialog::show();
......
...@@ -923,6 +923,10 @@ void SCHNApps::closeEvent(QCloseEvent *event) ...@@ -923,6 +923,10 @@ void SCHNApps::closeEvent(QCloseEvent *event)
QMainWindow::closeEvent(event); QMainWindow::closeEvent(event);
} }
void SCHNApps::statusBarMessage(const QString& msg, int msec)
{
statusbar->showMessage(msg, msec);
}
} // namespace SCHNApps } // namespace SCHNApps
......
...@@ -502,10 +502,30 @@ void View::keyPressEvent(QKeyEvent* event) ...@@ -502,10 +502,30 @@ void View::keyPressEvent(QKeyEvent* event)
if (event->key() == Qt::Key_S) if (event->key() == Qt::Key_S)
{ {
b_saveSnapshots = !b_saveSnapshots; b_saveSnapshots = !b_saveSnapshots;
if (b_saveSnapshots) if (b_saveSnapshots)
connect(this, SIGNAL(drawFinished(bool)), this, SLOT(saveSnapshot(bool))); {
QMessageBox msgBox;
msgBox.setText("Snapshot every frame?");
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Ok);
if (msgBox.exec() == QMessageBox::Ok)
{
m_schnapps->statusBarMessage("frame snapshot !!", 2000);
connect(this, SIGNAL(drawFinished(bool)), this, SLOT(saveSnapshot(bool)));
}
else
{
m_schnapps->statusBarMessage("cancel frame snapshot", 2000);
b_saveSnapshots = false;
}
}
else else
{
disconnect(this, SIGNAL(drawFinished(bool)), this, SLOT(saveSnapshot(bool))); disconnect(this, SIGNAL(drawFinished(bool)), this, SLOT(saveSnapshot(bool)));
m_schnapps->statusBarMessage("Stop frame snapshot", 2000);
}
} }
else else
{ {
......
Markdown is supported
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