~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/plugins/contrib/headerfixup/headerfixup.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
 
3
 * http://www.gnu.org/licenses/gpl-3.0.html
 
4
 *
 
5
 * $Revision$
 
6
 * $Id$
 
7
 * $HeadURL$
 
8
 */
 
9
 
 
10
#include <wx/window.h>
 
11
 
 
12
#include <sdk.h>
 
13
#include <cbproject.h>
 
14
#include <globals.h>
 
15
#include <manager.h>
 
16
#include <projectmanager.h>
 
17
 
 
18
#include "headerfixup.h"
 
19
#include "configuration.h"
 
20
#include "execution.h"
 
21
 
 
22
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 
23
 
 
24
namespace
 
25
{
 
26
  PluginRegistrant<HeaderFixup> reg(_T("HeaderFixup"));
 
27
}
 
28
 
 
29
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 
30
 
 
31
HeaderFixup::HeaderFixup()
 
32
{
 
33
  if ( !Manager::LoadResource(_T("headerfixup.zip")) )
 
34
  {
 
35
    NotifyMissingFile(_T("headerfixup.zip"));
 
36
  }
 
37
}// HeaderFixup
 
38
 
 
39
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 
40
 
 
41
HeaderFixup::~HeaderFixup()
 
42
{
 
43
}// ~HeaderFixup
 
44
 
 
45
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 
46
 
 
47
void HeaderFixup::OnAttach()
 
48
{
 
49
}// OnAttach
 
50
 
 
51
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 
52
 
 
53
void HeaderFixup::OnRelease(bool appShutDown)
 
54
{
 
55
}// OnRelease
 
56
 
 
57
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 
58
 
 
59
int HeaderFixup::Configure()
 
60
{
 
61
  cbConfigurationDialog dlg(Manager::Get()->GetAppWindow(), wxID_ANY, _("Header Fixup Config"));
 
62
  cbConfigurationPanel* panel = GetConfigurationPanel(&dlg);
 
63
  if (panel)
 
64
  {
 
65
    dlg.AttachConfigurationPanel(panel);
 
66
    PlaceWindow(&dlg);
 
67
    return dlg.ShowModal() == wxID_OK ? 0 : -1;
 
68
  }
 
69
  return 1;
 
70
}// Configure
 
71
 
 
72
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 
73
 
 
74
int HeaderFixup::Execute()
 
75
{
 
76
  // if not attached, exit
 
77
  if (!IsAttached())
 
78
    return -1;
 
79
 
 
80
  // if no project is opened -> inform the user and do not operate
 
81
  const cbProject* prj = Manager::Get()->GetProjectManager()->GetActiveProject();
 
82
  if (!prj)
 
83
  {
 
84
    cbMessageBox(_("You need to open a project/workspace before using this plugin!"),
 
85
                 _T("Header Fixup"), wxICON_ERROR | wxOK);
 
86
    return -1;
 
87
  }
 
88
 
 
89
  Execution Dlg(NULL);
 
90
  Dlg.ShowModal();
 
91
  return 0;
 
92
}// Execute
 
93
 
 
94
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
 
95
 
 
96
cbConfigurationPanel* HeaderFixup::GetConfigurationPanel(wxWindow* parent)
 
97
{
 
98
  return new Configuration(parent);
 
99
}// GetConfigurationPanel