• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kmail

  • sources
  • kde-4.12
  • kdepim
  • kmail
secondarywindow.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2  secondarywindow.cpp
3 
4  This file is part of KMail, the KDE mail client.
5  Copyright (c) 2003 Ingo Kloecker <kloecker@kde.org>
6 
7  KMail is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License, version 2, as
9  published by the Free Software Foundation.
10 
11  KMail is distributed in the hope that it will be useful, but
12  WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License along
17  with this program; if not, write to the Free Software Foundation, Inc.,
18  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 
20  In addition, as a special exception, the copyright holders give
21  permission to link the code of this program with any edition of
22  the Qt library by Trolltech AS, Norway (or with modified versions
23  of Qt that use the same license as Qt), and distribute linked
24  combinations including the two. You must obey the GNU General
25  Public License in all respects for all of the code used other than
26  Qt. If you modify this file, you may extend this exception to
27  your version of the file, but you are not obligated to do so. If
28  you do not wish to do so, delete this exception statement from
29  your version.
30 */
31 
32 
33 #include "secondarywindow.h"
34 #include "kmkernel.h"
35 
36 #include <kglobal.h>
37 #include <klocale.h>
38 
39 #include <QCloseEvent>
40 
41 namespace KMail {
42 
43  //---------------------------------------------------------------------------
44  SecondaryWindow::SecondaryWindow( const char * name )
45  : KXmlGuiWindow( 0 )
46  {
47  setObjectName( QLatin1String(name) );
48  // Set this to be the group leader for all subdialogs - this means
49  // modal subdialogs will only affect this window, not the other windows
50  setAttribute( Qt::WA_GroupLeader );
51  }
52 
53 
54  //---------------------------------------------------------------------------
55  SecondaryWindow::~SecondaryWindow()
56  {
57  }
58 
59 
60  //---------------------------------------------------------------------------
61  void SecondaryWindow::closeEvent( QCloseEvent * e )
62  {
63  // if there's a system tray applet then just do what needs to be done if a
64  // window is closed.
65  if ( kmkernel->haveSystemTrayApplet() ) {
66  // BEGIN of code borrowed from KMainWindow::closeEvent
67  // Save settings if auto-save is enabled, and settings have changed
68  if ( settingsDirty() && autoSaveSettings() )
69  saveAutoSaveSettings();
70 
71  if ( !queryClose() ) {
72  e->ignore();
73  }
74  // END of code borrowed from KMainWindow::closeEvent
75  } else {
76  KMainWindow::closeEvent( e );
77  }
78  }
79 
80  void SecondaryWindow::setCaption( const QString &userCaption )
81  {
82  QString caption = KGlobal::caption();
83  QString captionString = userCaption.isEmpty() ? caption : userCaption;
84  if ( !userCaption.isEmpty() ) {
85  // Add the application name if:
86  // User asked for it, it's not a duplication and the app name (caption()) is not empty
87  if ( !caption.isEmpty() ) {
88  captionString += i18nc("Document/application separator in titlebar", " – ") + caption;
89  }
90  }
91 
92  setWindowTitle(captionString);
93  }
94 
95 } // namespace KMail
96 
97 #include "secondarywindow.moc"
KMail::SecondaryWindow::closeEvent
virtual void closeEvent(QCloseEvent *)
Reimplemented because we don't want the application to quit when the last visible secondary window is...
Definition: secondarywindow.cpp:61
KMail::SecondaryWindow::~SecondaryWindow
~SecondaryWindow()
Definition: secondarywindow.cpp:55
KMail::SecondaryWindow::setCaption
virtual void setCaption(const QString &caption)
Reimplement because we have this bug #Bug 163978.
Definition: secondarywindow.cpp:80
KXmlGuiWindow
secondarywindow.h
kmkernel
#define kmkernel
Definition: kmkernel.h:22
kmkernel.h
KMail::SecondaryWindow::SecondaryWindow
SecondaryWindow(const char *name=0)
Definition: secondarywindow.cpp:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal