COPASI API  4.16.103
Public Member Functions | Protected Slots | Protected Attributes | Private Member Functions | Private Attributes | List of all members
CQProgressDialog Class Reference

#include <CQProgressDialog.h>

Inheritance diagram for CQProgressDialog:
Inheritance graph
[legend]
Collaboration diagram for CQProgressDialog:
Collaboration graph
[legend]

Public Member Functions

 CQProgressDialog (QWidget *parent=0, const char *name=0, Qt::WindowModality windowModality=Qt::WindowModal, Qt::WindowFlags fl=0)
 
bool insertProgressItem (CQProgressItem *pItem)
 
bool removeProgressItem (CQProgressItem *pItem)
 
 ~CQProgressDialog ()
 

Protected Slots

virtual void accept ()
 
virtual void btnContinuePressed ()
 
virtual void btnPausePressed ()
 
virtual void btnStopPressed ()
 
virtual void done (int)
 
virtual void reject ()
 
void timerShow ()
 

Protected Attributes

bool mPause
 
bool mProceed
 

Private Member Functions

void init ()
 

Private Attributes

unsigned C_INT32 mItemCount
 

Detailed Description

Definition at line 22 of file CQProgressDialog.h.

Constructor & Destructor Documentation

CQProgressDialog::CQProgressDialog ( QWidget *  parent = 0,
const char *  name = 0,
Qt::WindowModality  windowModality = Qt::WindowModal,
Qt::WindowFlags  fl = 0 
)

Definition at line 31 of file CQProgressDialog.cpp.

References init().

32  : QDialog(parent, fl)
33 {
34  setObjectName(QString::fromUtf8(name));
35 
36  setupUi(this);
37 
38  setWindowModality(windowModality);
39 
40  init();
41 }
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
CQProgressDialog::~CQProgressDialog ( )

Definition at line 46 of file CQProgressDialog.cpp.

47 {
48  // no need to delete child widgets, Qt does it all for us
49 }

Member Function Documentation

void CQProgressDialog::accept ( )
protectedvirtualslot

Definition at line 102 of file CQProgressDialog.cpp.

103 {
104  // ignore
105 }
void CQProgressDialog::btnContinuePressed ( )
protectedvirtualslot

Definition at line 111 of file CQProgressDialog.cpp.

References mPause.

Referenced by CProgressBar::btnContinuePressed().

112 {
113  mPause = false;
114 
115  mpBtnPause->setEnabled(true);
116  mpBtnContinue->setEnabled(false);
117 }
void CQProgressDialog::btnPausePressed ( )
protectedvirtualslot

Definition at line 119 of file CQProgressDialog.cpp.

References mPause.

120 {
121  mPause = true;
122 
123  mpBtnPause->setEnabled(false);
124  mpBtnContinue->setEnabled(true);
125 }
void CQProgressDialog::btnStopPressed ( )
protectedvirtualslot

Definition at line 127 of file CQProgressDialog.cpp.

References mPause, and mProceed.

Referenced by CProgressBar::btnStopPressed().

128 {
129  mPause = false;
130  mProceed = false;
131 
132  mpBtnPause->setEnabled(false);
133  mpBtnContinue->setEnabled(false);
134  mpBtnStop->setEnabled(false);
135 }
void CQProgressDialog::done ( int  )
protectedvirtualslot

Definition at line 98 of file CQProgressDialog.cpp.

Referenced by CProgressBar::finish().

99 {
100  // ignore
101 }
void CQProgressDialog::init ( )
private

Definition at line 76 of file CQProgressDialog.cpp.

References CQIconResource::icon(), mItemCount, mPause, mProceed, CQIconResource::playerPause, CQIconResource::playerStart, CQIconResource::playerStop, and timerShow().

Referenced by CQProgressDialog().

77 {
79  mpBtnContinue->setIcon(CQIconResource::icon(CQIconResource::playerStart));
81 
82  mpLine->hide();
83  // mpBtnPause->hide();
84  // mpBtnContinue->hide();
85 
86  mpBtnContinue->setEnabled(false);
87 
88  mItemCount = 0;
89 
90  mPause = false;
91  mProceed = true;
92 
93  QTimer::singleShot(1500, this, SLOT(timerShow()));
94 
95  return;
96 }
unsigned C_INT32 mItemCount
static const QIcon & icon(const IconID &id)
bool CQProgressDialog::insertProgressItem ( CQProgressItem pItem)

Definition at line 51 of file CQProgressDialog.cpp.

References mItemCount.

Referenced by CProgressBar::slotAddItem().

52 {
53  if (mItemCount == 0) mpLine->show();
54 
55  vboxLayout->removeItem(mpSpacer);
56  vboxLayout->addWidget(pItem);
57  vboxLayout->addItem(mpSpacer);
58 
59  pItem->show();
60 
61  mItemCount++;
62  return true;
63 }
unsigned C_INT32 mItemCount
void CQProgressDialog::reject ( )
protectedvirtualslot

Definition at line 106 of file CQProgressDialog.cpp.

107 {
108  // ignore
109 }
bool CQProgressDialog::removeProgressItem ( CQProgressItem pItem)

Definition at line 65 of file CQProgressDialog.cpp.

References mItemCount.

Referenced by CProgressBar::finish(), and CProgressBar::slotFinishItem().

66 {
67  vboxLayout->removeWidget(pItem);
68 
69  mItemCount--;
70 
71  if (mItemCount == 0) mpLine->hide();
72 
73  return true;
74 }
unsigned C_INT32 mItemCount
void CQProgressDialog::timerShow ( )
protectedslot

Definition at line 137 of file CQProgressDialog.cpp.

References CopasiUI3Window::getMainWindow().

Referenced by init().

138 {
139  if (CopasiUI3Window::getMainWindow() != NULL &&
140  CopasiUI3Window::getMainWindow()->messageShown())
141  {
142  QTimer::singleShot(1500, this, SLOT(timerShow()));
143  }
144  else
145  {
146  show();
147  }
148 }
static CopasiUI3Window * getMainWindow()

Member Data Documentation

unsigned C_INT32 CQProgressDialog::mItemCount
private

Definition at line 49 of file CQProgressDialog.h.

Referenced by init(), insertProgressItem(), and removeProgressItem().

bool CQProgressDialog::mPause
protected
bool CQProgressDialog::mProceed
protected

The documentation for this class was generated from the following files: