ODIN
odindialog_idea.h
1 /***************************************************************************
2  odindialog_idea.h - description
3  -------------------
4  begin : Fri Mar 9 21:30:11 CEST 2007
5  copyright : (C) 2000-2021 by Thies H. Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef ODINDIALOG_IDEA_H
19 #define ODINDIALOG_IDEA_H
20 
21 // Qt related headers first to avoid ambiguity with 'debug'
22 #include <qobject.h>
23 #include <odinqt/ldrwidget.h>
24 
25 #include <odinpara/ldrblock.h>
26 #include <odinpara/ldrtypes.h>
27 #include <odinpara/ldrnumbers.h>
28 
29 
30 #include "odinconf.h"
31 
32 struct IdeaOpts : LDRblock {
33 
34  IdeaOpts();
35 
36  bool set_defaults(const OdinConf& conf, STD_string* errmsg, QWidget *parent);
37 
38  STD_string get_vxworks_postfix() const;
39  STD_string get_vxworks_ext() const;
40  STD_string get_vxworks_Makefile() const;
41  STD_string get_vxworks_cxx() const {return odindir+"/bin/cxxwrapper.exe";}
42 
43  STD_string get_ideadir_slash() const {return replaceStr(ideadir,"\\","/");}
44  STD_string get_odindir_slash() const {return replaceStr(odindir,"\\","/");}
45 
46 
47  LDRfileName arch;
48 
49  LDRfileName ideadir;
50  LDRfileName odindir;
51 
52  LDRfileName msvcdir;
53 
54  LDRfileName seqdir;
55  LDRstring odin2idea_label;
56 
57  LDRfileName icedir;
58 
59  LDRenum vxworks_cpu;
60  LDRint vxworks_heap_size;
61  LDRbool debug_vxworks_host;
62 
63  LDRint make_jobs;
64  LDRbool make_clean;
65 
66 
67 
68  // read-only settings
69  LDRfileName vxworks_dir;
70  LDRstring vxworks_flags;
71  LDRstring vxworks_opts;
72  LDRfileName vxworks_path;
73  LDRfileName win_cxx;
74  LDRstring hostd_flags;
75  LDRstring host_flags;
76 
77 };
78 
79 
81 
82 
83 class IdeaDialog : public QObject, public GuiDialog {
84  Q_OBJECT
85 
86  public:
87  IdeaDialog(QWidget *parent, IdeaOpts& opts, const OdinConf& conf);
88  ~IdeaDialog();
89 
90  signals:
91  void changed();
92 
93  private slots:
94  void cancel();
95  void defaults();
96  void compile();
97  void update();
98 
99  private:
100  void do_compile();
101  void error_msg(const STD_string& msg);
102  int find_in_alternatives(const STD_string& findstr, const STD_list<STD_string>& alternatives);
103  bool execute_make(const STD_string& make, const STD_string& target);
104  STD_string hosttarget(bool debug, const STD_string& build_includes, const STD_string& global_conf, const STD_string& mprefix, const STD_string& make_install) const;
105  static STD_string errcodes_src(const STD_string& msgfile);
106 
107 
108 
109  IdeaOpts& opts_cache;
110  const OdinConf& conf_cache;
111  GuiGridLayout* grid;
112  GuiButton* pb_cancel;
113  GuiButton* pb_defaults;
114  GuiButton* pb_compile;
115  LDRwidget* optswidget;
116 
117 };
118 
120 
121 class IdeaMethodDialog : public QObject, public GuiDialog {
122  Q_OBJECT
123 
124  public:
125  IdeaMethodDialog(const STD_string& methdir, sarray& selectedMethods, const STD_string& install_prefix, const IdeaOpts& ideaopts, QWidget *parent);
126  ~IdeaMethodDialog();
127 
128 
129  private slots:
130  void make();
131  void emitDone();
132 
133  private:
134 
135  GuiButton* pb_make;
136  GuiButton* pb_cancel;
137  GuiGridLayout* grid;
138 
139  GuiListView* method_list;
140  STD_list<GuiListItem*> method_checks;
141 
142  sarray& selMeth;
143  STD_string methrootdir;
144  STD_string install_dir;
145 
146  const IdeaOpts& ideaopts_cache;
147 };
148 
149 
150 
151 #endif
STD_string replaceStr(const STD_string &s, const STD_string &searchstring, const STD_string &replacement, whichOccurences mode=allOccurences)