~ubuntu-branches/ubuntu/raring/ginkgocadx/raring-proposed

« back to all changes in this revision

Viewing changes to src/cadxcore/main/gui/countdownmessage/countdownmessage.cpp

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2011-09-09 08:39:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: package-import@ubuntu.com-20110909083926-iktecd132cnku5cd
Tags: 2.5.4.0~rc-1
New upstream version (patches were applied)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
3
 *  $Id: countdownmessage.cpp 4044 2011-07-22 12:21:07Z tovar $
 
4
 *  Ginkgo CADx Project
 
5
 *
 
6
 *  Copyright 2008-10 MetaEmotion S.L. All rights reserved.
 
7
 *  http://ginkgo-cadx.com
 
8
 *
 
9
 *  This file is licensed under LGPL v3 license.
 
10
 *  See License.txt for details
 
11
 *
 
12
 *
 
13
 */
 
14
 
 
15
#include "countdownmessage.h"
 
16
#include <wx/ginkgostyle/ginkgostyle.h>
 
17
 
 
18
namespace GNC {
 
19
        namespace GUI {
 
20
                CountdownMessage::CountdownMessage(wxWindow* pParent): CountdownMessageBase(pParent)
 
21
                {
 
22
                        m_last = 5;
 
23
                        m_pLabelInactivity->SetLabel(wxString::Format(_("Ginkgo CADx has detected inactivity and it will be closed in %d seconds.\nDo you want to continue?"), m_last));
 
24
                        m_pFormPanel->Layout();
 
25
                        m_pBody->Layout();
 
26
                        Layout();
 
27
                        m_cancelled = false;
 
28
                        this->Start(1000, true);
 
29
                }
 
30
 
 
31
                CountdownMessage::~CountdownMessage()
 
32
                {
 
33
                }
 
34
 
 
35
                bool CountdownMessage::Cancel()
 
36
                {
 
37
                        return m_cancelled;
 
38
                }
 
39
 
 
40
                void CountdownMessage::Notify()
 
41
                {
 
42
                        Freeze();
 
43
                        if (m_last > 0) {
 
44
                                m_last--;
 
45
                                m_pLabelInactivity->SetLabel(wxString::Format(_("Ginkgo CADx has detected inactivity and it will be closed in %d seconds.\nDo you want to continue?"), m_last));
 
46
                                m_pFormPanel->Layout();
 
47
                                m_pBody->Layout();
 
48
                                Layout();
 
49
                                this->Start(1000, true);
 
50
                        } else {
 
51
                                Close();
 
52
                        }
 
53
                        Thaw();
 
54
                }
 
55
 
 
56
                void CountdownMessage::OnCancel(wxCommandEvent &)
 
57
                {
 
58
                        m_cancelled = true;
 
59
                        Close();
 
60
                }
 
61
        }
 
62
}