File indexing completed on 2024-04-14 14:32:19

0001 //
0002 // C++ Implementation: cdialoglist
0003 //
0004 // Description: List of dialogs.
0005 //
0006 /*
0007 Copyright 2007-2011 Tomas Mecir <kmuddy@kmuddy.com>
0008 
0009 This program is free software; you can redistribute it and/or
0010 modify it under the terms of the GNU General Public License as
0011 published by the Free Software Foundation; either version 2 of 
0012 the License, or (at your option) any later version.
0013 
0014 This program is distributed in the hope that it will be useful,
0015 but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 GNU General Public License for more details.
0018 
0019 You should have received a copy of the GNU General Public License
0020 along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021 */
0022 
0023 #include "cdialoglist.h"
0024 
0025 cDialogList *cDialogList::_self = nullptr;
0026 
0027 cDialogList::cDialogList() : cActionBase ("dialog-list", 0)
0028 {
0029 }
0030 
0031 cDialogList::~cDialogList()
0032 {
0033 }
0034 
0035 cDialogList *cDialogList::self ()
0036 {
0037   if (!_self)
0038     _self = new cDialogList();
0039   return _self;
0040 }
0041 
0042 QDialog *cDialogList::getDialog (const QString &name) {
0043   if (dialogs.count (name))
0044     return dialogs[name];
0045   return nullptr;
0046 }
0047 
0048 void cDialogList::addDialog (const QString &name, QDialog *dlg) {
0049   dialogs[name] = dlg;
0050 }
0051 
0052 void cDialogList::removeDialog (const QString &name) {
0053   dialogs.erase (name);
0054 }
0055 
0056