| OpendTect 8.0

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
NotFinishedPrompter Class Reference
uiTools

`#include <uinotfinisheddlg.h>`

Inheritance diagram for NotFinishedPrompter:
[legend]

## Public Member Functions
| ~NotFinishedPrompter ()
void | addObject (const char *str)
void | addObject (const char *str, const CallBack &stopcb, const void *dataptr)
void | addObject (const uiString &str)
void | addObject (const uiString &str, const CallBack &stopcb, const void *dataptr)
bool | doTrigger (uiParent *, bool withcancel, const uiString &actiontype)
| Invoke the system. Returns false if cancel has been pressed.
const void * | getCurrentObjectData () const
uiParent * | getParent ()
int | queueID () const
void | removeObject (const char *)
void | removeObject (const uiString &)
void | reportSuccessfulStop ()
Public Member Functions inherited from CallBacker
| CallBacker ()
| CallBacker (const CallBacker &)
virtual | ~CallBacker ()
bool | attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
bool | attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
void | detachAllNotifiers () const
| Call from the destructor of your inherited object.
void | detachCB (const NotifierAccess &, const CallBack &) const
void | detachCB (const NotifierAccess *notif, const CallBack &cb) const
virtual bool | isCapsule () const
bool | isNotifierAttached (const NotifierAccess *) const
| Only for debugging purposes, don't use.
CallBacker & | operator= (const CallBacker &)=delete
void | stopReceivingNotifications () const
virtual CallBacker * | trueCaller ()

## Static Public Member Functions
static NotFinishedPrompter & | NFP ()
Static Public Member Functions inherited from CallBacker
static void | createReceiverForCurrentThread ()
static void | removeReceiverForCurrentThread ()

## Public Attributes
Notifier< NotFinishedPrompter > | promptEnding

## Protected Member Functions
| NotFinishedPrompter ()
void | closeQueueCB (CallBacker *)

## Protected Attributes
uiNotFinishedDlg * | dlg_ = nullptr
ObjectSet< NotFinishedPrompterData > | objects_
int | queueid_

## Friends
class | uiNotFinishedDlg

## Detailed Description

Presents a list of items that have not finished, giving the user the opportunity to abort the application exit or survey change.

MyClass::MyClass()
{
NotFinishedPrompter::NFP().promptStopping.notify(
mCB(this,MyClass,askStopCB) );
}
MyClass::~MyClass()
{
NotFinishedPrompter::NFP().promptStopping.remove(
mCB(this,MyClass,askStopCB) );
}
void MyClass::askStopCB( CallBacker* )
{
if ( still_running )
{
BufferString str("Process ", name() );
NotFinishedPrompter::NFP().addProcess( new NotFinishedPrompter::Data(
str.buf(), mCB(this,MyClass,stopCB()), nullptr ) );
}
}
void MyClass::stopCB( CallBacker* )
{
// Perform graceful exit of running process
NotFinishedPrompter::NFP().reportSuccessfulStop()
}
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition bufstring.h:38
CallBacker
Inherit from this class to be able to send and/or receive CallBacks.
Definition callback.h:184
NotFinishedPrompter::reportSuccessfulStop
void reportSuccessfulStop()
NotFinishedPrompter::NFP
static NotFinishedPrompter & NFP()

<>

## Constructor & Destructor Documentation

## ◆ ~NotFinishedPrompter()

NotFinishedPrompter::~NotFinishedPrompter | ( |  | ) |

## ◆ NotFinishedPrompter()

NotFinishedPrompter::NotFinishedPrompter | ( |  | ) |
| protected

## Member Function Documentation

## ◆ addObject() [1/4]

void NotFinishedPrompter::addObject | ( | const char * | str | ) |

## ◆ addObject() [2/4]

void NotFinishedPrompter::addObject | ( | const char * | str,
|  | const CallBack & | stopcb,
|  | const void * | dataptr )

## ◆ addObject() [3/4]

void NotFinishedPrompter::addObject | ( | const uiString & | str | ) |

Add a object to the list of running processes. Normally called when triggered by promptEnding. Use this version to register a process that doesn't need any special cleanup before being terminated.'

Parameters

  str | Description of the process

## ◆ addObject() [4/4]

void NotFinishedPrompter::addObject | ( | const uiString & | str,
|  | const CallBack & | stopcb,
|  | const void * | dataptr )

Add a object to the list if running processes. Normally called when triggered by promptEnding.Use this version to register a process that needs special cleanup before termination.

Parameters

  str | Description of the process
  stopcb | Callback that will stop the process
  dataptr | Pointer that can be retrieved during stopcb

## ◆ closeQueueCB()

void NotFinishedPrompter::closeQueueCB | ( | CallBacker * |  | ) |
| protected

## ◆ doTrigger()

bool NotFinishedPrompter::doTrigger | ( | uiParent * | ,
|  | bool | withcancel,
|  | const uiString & | actiontype )

Invoke the system. Returns false if cancel has been pressed.

## ◆ getCurrentObjectData()

const void * NotFinishedPrompter::getCurrentObjectData | ( |  | ) | const

Returns
  the dataptr of the currently active object.

Note
  Only valid during a call from a cb given in addProcess()

## ◆ getParent()

uiParent * NotFinishedPrompter::getParent | ( |  | ) |

Returns
  a pointer to the dialog, which can be used when creating a dialog in a callback given in addProcess.

Note
  Only valid during a call from a cb given in addProcess()

## ◆ NFP()

static NotFinishedPrompter & NotFinishedPrompter::NFP | ( |  | ) |
| static

## ◆ queueID()

int NotFinishedPrompter::queueID | ( |  | ) | const
| inline

When OK is pressed (i.e. not cancel), a queue is executed. If you want something to be executed, add it to this queue.

## ◆ removeObject() [1/2]

void NotFinishedPrompter::removeObject | ( | const char * |  | ) |

## ◆ removeObject() [2/2]

void NotFinishedPrompter::removeObject | ( | const uiString & |  | ) |

## ◆ reportSuccessfulStop()

void NotFinishedPrompter::reportSuccessfulStop | ( |  | ) |

Let the dialog know that the current process was successfully stopped. Only valid during a call from a cb given in addProcess()

## Friends And Related Symbol Documentation

## ◆ uiNotFinishedDlg

friend class uiNotFinishedDlg
| friend

## Member Data Documentation

## ◆ dlg_

uiNotFinishedDlg* NotFinishedPrompter::dlg_ = nullptr
| protected

## ◆ objects_

ObjectSet<NotFinishedPrompterData> NotFinishedPrompter::objects_
| protected

## ◆ promptEnding

Notifier<NotFinishedPrompter> NotFinishedPrompter::promptEnding

Will trigger from when users should be notified of running processes that will be terminated at events like survey change or application shutdown.

## ◆ queueid_

int NotFinishedPrompter::queueid_
| protected

Generated at
for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2025