~ubuntu-branches/ubuntu/karmic/codelite/karmic

« back to all changes in this revision

Viewing changes to QmakePlugin/newqtprojdlg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-08-15 17:42:43 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090815174243-nlb9ikgigbiybz12
Tags: 1.0.2893+dfsg-0ubuntu1
* debian/rules:
  + Tidy up get-orig-source rule
* debian/control:
  + Bump Standards-Version
  + Change Maintainer email address to @ubuntu.com
  + Drop cdbs build-dependency
* debian/copyright:
  + Update to DEP-5 format
* debian/patches/00_add-fPIC.patch:
  + Dropped, fix upstream
* Closes LP: #413992

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "newqtprojdlg.h"
 
2
#include "qmakesettingsdlg.h"
 
3
#include "qmakeconf.h"
 
4
#include "imanager.h"
 
5
#include "windowattrmanager.h"
 
6
#include "workspace.h"
 
7
#include <wx/dirdlg.h>
 
8
 
 
9
NewQtProjDlg::NewQtProjDlg( wxWindow* parent, QmakeConf *conf, IManager *mgr )
 
10
                : NewQtProjBaseDlg( parent )
 
11
                , m_conf(conf)
 
12
                , m_mgr (mgr)
 
13
{
 
14
        m_choiceQmake->Append(m_conf->GetAllConfigurations());
 
15
        if (m_choiceQmake->IsEmpty() == false) {
 
16
                m_choiceQmake->SetSelection(0);
 
17
        }
 
18
 
 
19
        if( m_mgr->IsWorkspaceOpen() ) {
 
20
                m_textCtrl->SetValue( m_mgr->GetWorkspace()->GetWorkspaceFileName().GetPath() );
 
21
        }
 
22
 
 
23
        WindowAttrManager::Load(this, wxT("NewQtProjDlg"), m_mgr->GetConfigTool());
 
24
}
 
25
 
 
26
NewQtProjDlg::~NewQtProjDlg()
 
27
{
 
28
        WindowAttrManager::Save(this, wxT("NewQtProjDlg"), m_mgr->GetConfigTool());
 
29
}
 
30
 
 
31
void NewQtProjDlg::OnBrowseProjectPath( wxCommandEvent& event )
 
32
{
 
33
        wxUnusedVar (event);
 
34
 
 
35
        wxString initPath;
 
36
        if ( m_mgr->IsWorkspaceOpen() ) {
 
37
                initPath = m_mgr->GetWorkspace()->GetWorkspaceFileName().GetPath();
 
38
        }
 
39
        wxString new_path = wxDirSelector(wxT("Select directory:"), initPath, wxDD_DEFAULT_STYLE, wxDefaultPosition, this);
 
40
        if (new_path.IsEmpty() == false) {
 
41
                m_textCtrl->SetValue(new_path);
 
42
        }
 
43
}
 
44
 
 
45
void NewQtProjDlg::OnNewQmakeSettings( wxCommandEvent& event )
 
46
{
 
47
        QMakeSettingsDlg dlg(this, m_mgr, m_conf);
 
48
        if (dlg.ShowModal() == wxID_OK) {
 
49
                m_choiceQmake->Clear();
 
50
                m_choiceQmake->Append(m_conf->GetAllConfigurations());
 
51
                if (m_choiceQmake->IsEmpty() == false) {
 
52
                        m_choiceQmake->SetSelection(0);
 
53
                }
 
54
        }
 
55
}
 
56
 
 
57
bool NewQtProjDlg::GetCreateDirectory() const
 
58
{
 
59
        return m_checkBoxUseSepDirectory->IsChecked();
 
60
}
 
61
 
 
62
wxString NewQtProjDlg::GetProjectKind() const
 
63
{
 
64
        return m_choiceProjKind->GetStringSelection();
 
65
}
 
66
 
 
67
wxString NewQtProjDlg::GetProjectName() const
 
68
{
 
69
        return m_textCtrlProjName->GetValue();
 
70
}
 
71
 
 
72
wxString NewQtProjDlg::GetProjectPath() const
 
73
{
 
74
        return m_textCtrl->GetValue();
 
75
}
 
76
 
 
77
wxString NewQtProjDlg::GetQmake() const
 
78
{
 
79
        return m_choiceQmake->GetStringSelection();
 
80
}
 
81