4
* Gnome Chemistry Utils
7
* Copyright (C) 2005-2007 Jean Bréfort <jean.brefort@normalesup.org>
9
* This program is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU General Public License as
11
* published by the Free Software Foundation; either version 2 of the
12
* License, or (at your option) any later version.
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
26
#include "dialog-owner.h"
34
DialogOwner::DialogOwner ()
38
DialogOwner::~DialogOwner ()
43
Dialog *DialogOwner::GetDialog (string name)
45
map <string, Dialog *>::iterator i = Dialogs.find (name);
46
return (i != Dialogs.end ())? (*i).second: NULL;
49
bool DialogOwner::AddDialog (string name, Dialog *dialog)
52
Dialogs[name]->Present ();
55
Dialogs[name] = dialog;
59
void DialogOwner::ClearDialogs ()
61
map <string, Dialog *>::iterator i;
62
while (!Dialogs.empty ()) {
65
(*i).second->Destroy ();