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

« back to all changes in this revision

Viewing changes to src/plugins/contrib/BrowseTracker/BrowseTrackerCfg.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 Browse Tracker, a plugin for Code::Blocks
3
 
        Copyright (C) 2007 Pecan Heber
4
 
 
5
 
        This program is free software; you can redistribute it and/or
6
 
        modify it under the terms of the GNU General Public License
7
 
        as published by the Free Software Foundation; either version 2
8
 
        of the License, or (at your option) any later version.
9
 
 
10
 
        This program is distributed in the hope that it will be useful,
11
 
        but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
        GNU General Public License for more details.
14
 
 
15
 
        You should have received a copy of the GNU General Public License
16
 
        along with this program; if not, write to the Free Software
17
 
        Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
 
*/
19
 
// RCS-ID: $Id: BrowseTracker.cpp 22 2007-12-18 14:41:58Z Pecan $
20
 
 
21
 
#include <wx/fileconf.h>
22
 
 
23
 
#include "BrowseTrackerDefs.h"
24
 
#include "BrowseTrackerCfg.h"
25
 
#include "ConfigDlg.h"
26
 
#include "manager.h"
27
 
#include "Version.h"
28
 
 
29
 
// ----------------------------------------------------------------------------
30
 
BrowseTrackerCfg::BrowseTrackerCfg()
31
 
// ----------------------------------------------------------------------------
32
 
    :m_configDlg(Manager::Get()->GetAppWindow() )
33
 
{
34
 
    //ctor
35
 
    pCfgFile = 0;
36
 
}
37
 
// ----------------------------------------------------------------------------
38
 
void BrowseTrackerCfg::GetUserOptions(wxString configFullPath)
39
 
// ----------------------------------------------------------------------------
40
 
{
41
 
 
42
 
    ReadUserOptions( configFullPath );
43
 
 
44
 
    #if defined(__WXMSW__)
45
 
    m_configDlg.m_staticText4->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVECAPTION ) );
46
 
    #endif
47
 
 
48
 
    // set the current values
49
 
    m_configDlg.Cfg_BrowseMarksEnabled->SetValue( m_BrowseMarksEnabled);
50
 
    m_configDlg.Cfg_MarkStyle->SetSelection(m_UserMarksStyle);
51
 
    m_configDlg.Cfg_ToggleKey->SetSelection( m_ToggleKey );
52
 
        m_configDlg.Cfg_LeftMouseDelay->SetValue( m_LeftMouseDelay ) ;
53
 
        m_configDlg.Cfg_ClearAllKey->SetSelection( m_ClearAllKey ) ;
54
 
 
55
 
    m_configDlg.ShowModal();
56
 
 
57
 
    // get any new user values
58
 
    m_BrowseMarksEnabled = m_configDlg.Cfg_BrowseMarksEnabled->GetValue();
59
 
    m_UserMarksStyle = m_configDlg.Cfg_MarkStyle->GetSelection();
60
 
    m_ToggleKey = m_configDlg.Cfg_ToggleKey->GetSelection();
61
 
        m_LeftMouseDelay = m_configDlg.Cfg_LeftMouseDelay->GetValue();
62
 
        m_ClearAllKey = m_configDlg.Cfg_ClearAllKey->GetSelection();
63
 
 
64
 
    // write user options to config file
65
 
        SaveUserOptions( configFullPath );
66
 
 
67
 
}//Init
68
 
// ----------------------------------------------------------------------------
69
 
BrowseTrackerCfg::~BrowseTrackerCfg()
70
 
// ----------------------------------------------------------------------------
71
 
{
72
 
    //dtor
73
 
}
74
 
// ----------------------------------------------------------------------------
75
 
void BrowseTrackerCfg::ReadUserOptions(wxString configFullPath)
76
 
// ----------------------------------------------------------------------------
77
 
{
78
 
    if (not pCfgFile) pCfgFile = new wxFileConfig(
79
 
                    wxEmptyString,              // appname
80
 
                    wxEmptyString,              // vendor
81
 
                    configFullPath,             // local filename
82
 
                    wxEmptyString,              // global file
83
 
                    wxCONFIG_USE_LOCAL_FILE);
84
 
                    //0);
85
 
    wxFileConfig& cfgFile = *pCfgFile;
86
 
 
87
 
        cfgFile.Read( wxT("BrowseMarksEnabled"),        &m_BrowseMarksEnabled, 0 ) ;
88
 
        cfgFile.Read( wxT("BrowseMarksStyle"),          &m_UserMarksStyle, 0 ) ;
89
 
        cfgFile.Read( wxT("BrowseMarksToggleKey"),      &m_ToggleKey, Left_Mouse ) ;
90
 
        cfgFile.Read( wxT("LeftMouseDelay"),            &m_LeftMouseDelay, 200 ) ;
91
 
        cfgFile.Read( wxT("BrowseMarksClearAllMethod"), &m_ClearAllKey, ClearAllOnSingleClick ) ;
92
 
 
93
 
}
94
 
// ----------------------------------------------------------------------------
95
 
void BrowseTrackerCfg::SaveUserOptions(wxString configFullPath)
96
 
// ----------------------------------------------------------------------------
97
 
{
98
 
    if (not pCfgFile) pCfgFile = new wxFileConfig(
99
 
                    wxEmptyString,              // appname
100
 
                    wxEmptyString,              // vendor
101
 
                    configFullPath,             // local filename
102
 
                    wxEmptyString,              // global file
103
 
                    wxCONFIG_USE_LOCAL_FILE);
104
 
                    //0);
105
 
    wxFileConfig& cfgFile = *pCfgFile;
106
 
 
107
 
        cfgFile.Write( wxT("BrowseMarksEnabled"),       m_BrowseMarksEnabled ) ;
108
 
        cfgFile.Write( wxT("BrowseMarksStyle"),         m_UserMarksStyle ) ;
109
 
    cfgFile.Write( wxT("BrowseMarksToggleKey"),     m_ToggleKey ) ;
110
 
    cfgFile.Write( wxT("LeftMouseDelay"),           m_LeftMouseDelay ) ;
111
 
    cfgFile.Write( wxT("BrowseMarksClearAllMethod"),m_ClearAllKey ) ;
112
 
 
113
 
    cfgFile.Flush();
114
 
 
115
 
}
116
 
// ----------------------------------------------------------------------------
117
 
 
118