OpendTect-6_4  6.4
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
NotSavedPrompter Class Reference
Inheritance diagram for NotSavedPrompter:
[legend]

Public Member Functions

int queueID () const
 
void addObject (const uiString &str, const CallBack &savecb, bool issaveas, const void *dataptr)
 
void addObject (const char *str, const CallBack &savecb, bool issaveas, const void *dataptr)
 
bool isSaveAs () const
 
const void * getCurrentObjectData () const
 
uiParentgetParent ()
 
void reportSuccessfullSave ()
 
 NotSavedPrompter ()
 
 ~NotSavedPrompter ()
 
bool doTrigger (uiParent *, bool withcancel, const uiString &actiontype)
 Invoke the system. Returns false if cancel has been pressed. More...
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 

Static Public Member Functions

static NotSavedPrompterNSP ()
 

Public Attributes

Notifier< NotSavedPrompterpromptSaving
 

Protected Member Functions

void closeQueueCB (CallBacker *cb)
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 

Protected Attributes

ObjectSet< NotSavedPrompterData > objects_
 
uiNotSavedDlgdlg_
 
int queueid_
 

Private Member Functions

 mODTextTranslationClass (NotSavedPrompter)
 

Friends

class uiNotSavedDlg
 

Detailed Description

Presents a list of items that have not been saved, giving the user the opportunity to save them.

MyClass::MyClass()
{
mCB(this,MyClass,askSaveCB) );
}
MyClass::~MyClass()
{
mCB(this,MyClass,askSaveCB) );
}
void MyClass::askSaveCB( CallBacker* )
{
if ( not_saved )
{
BufferString str("Object type \"" );
str += name(); str += "\"";
PtrMan<IOObj> ioobj = IOM().get( mid );
const bool issaveas = (bool) ioobj;
str.buf(), mCB(this,MyClass,saveCB()), issaveas, 0 ) );
}
}
void MyClass::saveCB( CallBacker* )
{
{
//Start dlg with uiparent and get new name
}
if ( successfulSave )
}

Constructor & Destructor Documentation

NotSavedPrompter::NotSavedPrompter ( )
NotSavedPrompter::~NotSavedPrompter ( )
inline

Member Function Documentation

void NotSavedPrompter::addObject ( const uiString str,
const CallBack savecb,
bool  issaveas,
const void *  dataptr 
)

Lets the object know that you have an object that should be added to the list of unsaved objects. Normally called when triggered by promptSaving.

Parameters
strDescription of the object (e.g. "Horizon A")
savecbCallback that will save the object
issaveastrue if savecb will prompt user for a name
dataptrPointer that can be retrieved during savecb
void NotSavedPrompter::addObject ( const char *  str,
const CallBack savecb,
bool  issaveas,
const void *  dataptr 
)

Lets the object know that you have an object that should be added to the list of unsaved objects. Normally called when triggered by promptSaving.

Parameters
strDescription of the object (e.g. "Horizon A")
savecbCallback that will save the object
issaveastrue if savecb will prompt user for a name
dataptrPointer that can be retrieved during savecb
void NotSavedPrompter::closeQueueCB ( CallBacker cb)
protected
bool NotSavedPrompter::doTrigger ( uiParent ,
bool  withcancel,
const uiString actiontype 
)

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

const void* NotSavedPrompter::getCurrentObjectData ( ) const
Returns
the dataptr of the currently active object.
Note
Only valid during a call from a cb given in addObject()
uiParent* NotSavedPrompter::getParent ( )
Returns
a pointer to the save-dialog, which can be used when creating a dialog in a callback given in addObject.
Note
Only valid during a call from a cb given in addObject()
bool NotSavedPrompter::isSaveAs ( ) const
Returns
the issaveas status of the currently active object
Note
Only valid during a call from a cb given in addObject()
NotSavedPrompter::mODTextTranslationClass ( NotSavedPrompter  )
private
static NotSavedPrompter& NotSavedPrompter::NSP ( )
static
int NotSavedPrompter::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.

void NotSavedPrompter::reportSuccessfullSave ( )

Let the dialog know that the current object was successfully saved.

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

Friends And Related Function Documentation

friend class uiNotSavedDlg
friend

Member Data Documentation

uiNotSavedDlg* NotSavedPrompter::dlg_
protected
ObjectSet<NotSavedPrompterData> NotSavedPrompter::objects_
protected
Notifier<NotSavedPrompter> NotSavedPrompter::promptSaving

Will trigger from when users should save all unsaved objects, normally at survey change or shutdown.

int NotSavedPrompter::queueid_
protected

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