PageRenderTime 273ms CodeModel.GetById 178ms app.highlight 78ms RepoModel.GetById 1ms app.codeStats 1ms

/src/mpv5/ui/dialogs/subcomponents/ControlPanel_Userproperties.java

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
Java | 848 lines | 747 code | 90 blank | 11 comment | 2 complexity | 7a0e7c08cfc249b441e3368ab92cea12 MD5 | raw file
  1package mpv5.ui.dialogs.subcomponents;
  2
  3import java.awt.Component;
  4import java.util.logging.Level;
  5import java.util.logging.Logger;
  6import javax.swing.JCheckBox;
  7import javax.swing.SwingUtilities;
  8import mpv5.data.PropertyStore;
  9import mpv5.db.common.Context;
 10import mpv5.db.common.NodataFoundException;
 11import mpv5.db.objects.User;
 12import mpv5.globals.Messages;
 13import mpv5.logging.Log;
 14import mpv5.ui.beans.LightMPComboBox;
 15import mpv5.ui.dialogs.ControlApplet;
 16import mpv5.ui.dialogs.Popup;
 17import mpv5.ui.panels.MPControlPanel;
 18
 19/**
 20 *
 21 * 
 22 */
 23public class ControlPanel_Userproperties extends javax.swing.JPanel implements ControlApplet {
 24
 25    private static final long serialVersionUID = -8347532498124147821L;
 26    /**
 27     * This unique name identifies this control applet
 28     */
 29    public final String UNAME = "userproperties";
 30    private PropertyStore oldvalues;
 31    private static ControlPanel_Userproperties ident;
 32    private java.util.ResourceBundle bundle = mpv5.i18n.LanguageManager.getBundle();
 33
 34    public ControlPanel_Userproperties() {
 35        initComponents();
 36
 37        defcount.set_ValueClass(Double.class);
 38        deftax.setSearchEnabled(true);
 39        deftax.setContext(Context.getTaxes());
 40        deftax.triggerSearch();
 41
 42        shiptax.setSearchEnabled(true);
 43        shiptax.setContext(Context.getTaxes());
 44        shiptax.triggerSearch();
 45
 46//        savedir.setFilter(DialogForFile.DIRECTORIES);
 47
 48        loadSettings();
 49        try {
 50            groupl.setText(User.getCurrentUser().getGroup().__getCname());
 51        } catch ( Exception ex) {
 52            Log.Debug(ex);
 53        }
 54    }
 55
 56    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
 57    private void initComponents() {
 58
 59        jPanel1 = new javax.swing.JPanel();
 60        jPanel2 = new javax.swing.JPanel();
 61        productstobillsproperties = new javax.swing.JPanel();
 62        cname = new javax.swing.JCheckBox();
 63        description = new javax.swing.JCheckBox();
 64        cnumber = new javax.swing.JCheckBox();
 65        reference = new javax.swing.JCheckBox();
 66        ean = new javax.swing.JCheckBox();
 67        jButton3 = new javax.swing.JButton();
 68        defs = new javax.swing.JPanel();
 69        defcount = new mpv5.ui.beans.LabeledTextField();
 70        defunit = new mpv5.ui.beans.LabeledTextField();
 71        deftax = new mpv5.ui.beans.LabeledCombobox();
 72        shiptax = new mpv5.ui.beans.LabeledCombobox();
 73        autorev = new javax.swing.JCheckBox();
 74        format = new mpv5.ui.beans.LabeledTextField();
 75        jPanel3 = new javax.swing.JPanel();
 76        columnquantity = new javax.swing.JCheckBox();
 77        columnmeasure = new javax.swing.JCheckBox();
 78        hidetaxcolumn = new javax.swing.JCheckBox();
 79        hidediscountcolumn = new javax.swing.JCheckBox();
 80        hideproductscolumn = new javax.swing.JCheckBox();
 81        showoptionalcolumn = new javax.swing.JCheckBox();
 82        jPanel9 = new javax.swing.JPanel();
 83        smtphost = new mpv5.ui.beans.LabeledTextField();
 84        smtpuser = new mpv5.ui.beans.LabeledTextField();
 85        jLabel3 = new javax.swing.JLabel();
 86        smtppw = new javax.swing.JPasswordField();
 87        smtptls = new javax.swing.JCheckBox();
 88        smtps = new javax.swing.JCheckBox();
 89        jButton4 = new javax.swing.JButton();
 90        jPanel4 = new javax.swing.JPanel();
 91        saveformat = new mpv5.ui.beans.LabeledTextField();
 92        jScrollPane1 = new javax.swing.JScrollPane();
 93        jTextPane1 = new javax.swing.JTextPane();
 94        jPanel10 = new javax.swing.JPanel();
 95        dtabankid = new mpv5.ui.beans.LabeledTextField();
 96        dtabankaccount = new mpv5.ui.beans.LabeledTextField();
 97        dtabankname = new mpv5.ui.beans.LabeledTextField();
 98        dtabankcountry = new mpv5.ui.beans.LabeledTextField();
 99        jLabel4 = new javax.swing.JLabel();
100        jScrollPane2 = new javax.swing.JScrollPane();
101        dtausage0 = new javax.swing.JTextPane();
102        jPanel5 = new javax.swing.JPanel();
103        tabs = new javax.swing.JCheckBox();
104        supresscurrencysymbols = new javax.swing.JCheckBox();
105        ordersoverproducts = new javax.swing.JCheckBox();
106        companiesovernames = new javax.swing.JCheckBox();
107        pasten = new javax.swing.JCheckBox();
108        nowarnings = new javax.swing.JCheckBox();
109        unpaidbills = new javax.swing.JCheckBox();
110        views = new javax.swing.JCheckBox();
111        jPanel7 = new javax.swing.JPanel();
112        groupl = new javax.swing.JLabel();
113        jPanel6 = new javax.swing.JPanel();
114        jButton2 = new javax.swing.JButton();
115        jButton1 = new javax.swing.JButton();
116        jButton5 = new javax.swing.JButton();
117
118        setBackground(new java.awt.Color(255, 255, 255));
119        setName("Form"); // NOI18N
120        setLayout(new java.awt.BorderLayout());
121
122        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
123        java.util.ResourceBundle bundle = mpv5.i18n.LanguageManager.getBundle(); // NOI18N
124        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("ControlPanel_Userproperties.jPanel1.border.title"))); // NOI18N
125        jPanel1.setName("jPanel1"); // NOI18N
126
127        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("ControlPanel_Userproperties.jPanel2.border.title"))); // NOI18N
128        jPanel2.setName("jPanel2"); // NOI18N
129
130        productstobillsproperties.setName("productstobillsproperties"); // NOI18N
131
132        cname.setText(bundle.getString("ControlPanel_Userproperties.cname.text")); // NOI18N
133        cname.setName("cname"); // NOI18N
134
135        description.setText(bundle.getString("ControlPanel_Userproperties.description.text")); // NOI18N
136        description.setName("description"); // NOI18N
137
138        cnumber.setText(bundle.getString("ControlPanel_Userproperties.cnumber.text")); // NOI18N
139        cnumber.setName("cnumber"); // NOI18N
140
141        reference.setText(bundle.getString("ControlPanel_Userproperties.reference.text")); // NOI18N
142        reference.setName("reference"); // NOI18N
143
144        ean.setText(bundle.getString("ControlPanel_Userproperties.ean.text")); // NOI18N
145        ean.setName("ean"); // NOI18N
146
147        jButton3.setText(bundle.getString("ControlPanel_Userproperties.jButton3.text")); // NOI18N
148        jButton3.setName("jButton3"); // NOI18N
149        jButton3.addActionListener(new java.awt.event.ActionListener() {
150            public void actionPerformed(java.awt.event.ActionEvent evt) {
151                jButton3ActionPerformed(evt);
152            }
153        });
154
155        javax.swing.GroupLayout productstobillspropertiesLayout = new javax.swing.GroupLayout(productstobillsproperties);
156        productstobillsproperties.setLayout(productstobillspropertiesLayout);
157        productstobillspropertiesLayout.setHorizontalGroup(
158            productstobillspropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
159            .addGroup(productstobillspropertiesLayout.createSequentialGroup()
160                .addContainerGap()
161                .addGroup(productstobillspropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
162                    .addComponent(cnumber, javax.swing.GroupLayout.DEFAULT_SIZE, 293, Short.MAX_VALUE)
163                    .addComponent(description, javax.swing.GroupLayout.DEFAULT_SIZE, 293, Short.MAX_VALUE)
164                    .addComponent(cname, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 293, Short.MAX_VALUE))
165                .addGap(8, 8, 8)
166                .addGroup(productstobillspropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
167                    .addComponent(ean, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)
168                    .addComponent(reference, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)
169                    .addComponent(jButton3))
170                .addContainerGap())
171        );
172        productstobillspropertiesLayout.setVerticalGroup(
173            productstobillspropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
174            .addGroup(productstobillspropertiesLayout.createSequentialGroup()
175                .addContainerGap()
176                .addGroup(productstobillspropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
177                    .addComponent(cname)
178                    .addComponent(ean))
179                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
180                .addGroup(productstobillspropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
181                    .addComponent(description)
182                    .addComponent(reference))
183                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
184                .addGroup(productstobillspropertiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
185                    .addComponent(cnumber)
186                    .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
187                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
188        );
189
190        defs.setName("defs"); // NOI18N
191
192        defcount.set_Label(bundle.getString("ControlPanel_Userproperties.defcount._Label")); // NOI18N
193        defcount.set_Text(bundle.getString("ControlPanel_Userproperties.defcount._Text")); // NOI18N
194        defcount.setName("defcount"); // NOI18N
195
196        defunit.set_Label(bundle.getString("ControlPanel_Userproperties.defunit._Label")); // NOI18N
197        defunit.set_Text(bundle.getString("ControlPanel_Userproperties.defunit._Text")); // NOI18N
198        defunit.setName("defunit"); // NOI18N
199
200        deftax.set_Label(bundle.getString("ControlPanel_Userproperties.deftax._Label")); // NOI18N
201        deftax.setName("deftax"); // NOI18N
202
203        shiptax.set_Label(bundle.getString("ControlPanel_Userproperties.shiptax._Label")); // NOI18N
204        shiptax.setName("shiptax"); // NOI18N
205
206        autorev.setText(bundle.getString("ControlPanel_Userproperties.autorev.text")); // NOI18N
207        autorev.setEnabled(false);
208        autorev.setName("autorev"); // NOI18N
209
210        javax.swing.GroupLayout defsLayout = new javax.swing.GroupLayout(defs);
211        defs.setLayout(defsLayout);
212        defsLayout.setHorizontalGroup(
213            defsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
214            .addGroup(defsLayout.createSequentialGroup()
215                .addContainerGap()
216                .addGroup(defsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
217                    .addGroup(defsLayout.createSequentialGroup()
218                        .addComponent(defunit, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
219                        .addGap(18, 18, 18)
220                        .addComponent(defcount, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
221                    .addComponent(autorev, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE))
222                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
223                .addGroup(defsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
224                    .addComponent(shiptax, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 233, Short.MAX_VALUE)
225                    .addComponent(deftax, javax.swing.GroupLayout.DEFAULT_SIZE, 233, Short.MAX_VALUE)))
226        );
227        defsLayout.setVerticalGroup(
228            defsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
229            .addGroup(defsLayout.createSequentialGroup()
230                .addContainerGap()
231                .addGroup(defsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
232                    .addGroup(defsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
233                        .addComponent(deftax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
234                        .addComponent(defcount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
235                    .addComponent(defunit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
236                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
237                .addGroup(defsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
238                    .addComponent(autorev)
239                    .addComponent(shiptax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
240                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
241        );
242
243        format.set_Label(bundle.getString("ControlPanel_Userproperties.format._Label")); // NOI18N
244        format.setName("format"); // NOI18N
245
246        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
247        jPanel2.setLayout(jPanel2Layout);
248        jPanel2Layout.setHorizontalGroup(
249            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
250            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
251                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
252                    .addComponent(productstobillsproperties, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
253                    .addGroup(jPanel2Layout.createSequentialGroup()
254                        .addGap(10, 10, 10)
255                        .addComponent(format, javax.swing.GroupLayout.DEFAULT_SIZE, 612, Short.MAX_VALUE))
256                    .addComponent(defs, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
257                .addContainerGap())
258        );
259        jPanel2Layout.setVerticalGroup(
260            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
261            .addGroup(jPanel2Layout.createSequentialGroup()
262                .addComponent(productstobillsproperties, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
263                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
264                .addComponent(format, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
265                .addGap(14, 14, 14)
266                .addComponent(defs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
267        );
268
269        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("ControlPanel_Userproperties.jPanel3.border.title"))); // NOI18N
270        jPanel3.setName("jPanel3"); // NOI18N
271        jPanel3.setLayout(new javax.swing.BoxLayout(jPanel3, javax.swing.BoxLayout.PAGE_AXIS));
272
273        columnquantity.setText(bundle.getString("ControlPanel_Userproperties.columnquantity.text")); // NOI18N
274        columnquantity.setName("columnquantity"); // NOI18N
275        jPanel3.add(columnquantity);
276
277        columnmeasure.setText(bundle.getString("ControlPanel_Userproperties.columnmeasure.text")); // NOI18N
278        columnmeasure.setName("columnmeasure"); // NOI18N
279        jPanel3.add(columnmeasure);
280
281        hidetaxcolumn.setText(bundle.getString("ControlPanel_Userproperties.hidetaxcolumn.text")); // NOI18N
282        hidetaxcolumn.setName("hidetaxcolumn"); // NOI18N
283        jPanel3.add(hidetaxcolumn);
284
285        hidediscountcolumn.setText(bundle.getString("ControlPanel_Userproperties.hidediscountcolumn.text")); // NOI18N
286        hidediscountcolumn.setName("hidediscountcolumn"); // NOI18N
287        jPanel3.add(hidediscountcolumn);
288
289        hideproductscolumn.setText(bundle.getString("ControlPanel_Userproperties.hideproductscolumn.text")); // NOI18N
290        hideproductscolumn.setName("hideproductscolumn"); // NOI18N
291        jPanel3.add(hideproductscolumn);
292
293        showoptionalcolumn.setText(bundle.getString("ControlPanel_Userproperties.showoptionalcolumn.text")); // NOI18N
294        showoptionalcolumn.setName("showoptionalcolumn"); // NOI18N
295        jPanel3.add(showoptionalcolumn);
296
297        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("ControlPanel_Userproperties.jPanel9.border.title"))); // NOI18N
298        jPanel9.setName("jPanel9"); // NOI18N
299
300        smtphost.set_Label(bundle.getString("ControlPanel_Userproperties.smtphost._Label")); // NOI18N
301        smtphost.setName("smtphost"); // NOI18N
302
303        smtpuser.set_Label(bundle.getString("ControlPanel_Userproperties.smtpuser._Label")); // NOI18N
304        smtpuser.setName("smtpuser"); // NOI18N
305
306        jLabel3.setText(bundle.getString("ControlPanel_Userproperties.jLabel3.text")); // NOI18N
307        jLabel3.setName("jLabel3"); // NOI18N
308
309        smtppw.setText(bundle.getString("ControlPanel_Userproperties.smtppw.text")); // NOI18N
310        smtppw.setName("smtppw"); // NOI18N
311
312        smtptls.setText(bundle.getString("ControlPanel_Userproperties.smtptls.text")); // NOI18N
313        smtptls.setName("smtptls"); // NOI18N
314
315        smtps.setText(bundle.getString("ControlPanel_Userproperties.smtps.text")); // NOI18N
316        smtps.setName("smtps"); // NOI18N
317
318        jButton4.setText(bundle.getString("ControlPanel_Userproperties.jButton4.text")); // NOI18N
319        jButton4.setName("jButton4"); // NOI18N
320        jButton4.addActionListener(new java.awt.event.ActionListener() {
321            public void actionPerformed(java.awt.event.ActionEvent evt) {
322                jButton4ActionPerformed(evt);
323            }
324        });
325
326        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
327        jPanel9.setLayout(jPanel9Layout);
328        jPanel9Layout.setHorizontalGroup(
329            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
330            .addGroup(jPanel9Layout.createSequentialGroup()
331                .addContainerGap()
332                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
333                    .addGroup(jPanel9Layout.createSequentialGroup()
334                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
335                            .addComponent(smtphost, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE)
336                            .addGroup(jPanel9Layout.createSequentialGroup()
337                                .addComponent(smtptls, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
338                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
339                                .addComponent(smtps, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
340                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
341                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
342                            .addGroup(jPanel9Layout.createSequentialGroup()
343                                .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
344                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
345                                .addComponent(smtppw, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE))
346                            .addComponent(smtpuser, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 216, javax.swing.GroupLayout.PREFERRED_SIZE)))
347                    .addComponent(jButton4))
348                .addContainerGap(153, Short.MAX_VALUE))
349        );
350        jPanel9Layout.setVerticalGroup(
351            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
352            .addGroup(jPanel9Layout.createSequentialGroup()
353                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
354                    .addGroup(jPanel9Layout.createSequentialGroup()
355                        .addComponent(smtpuser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
356                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
357                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
358                            .addComponent(smtppw, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
359                            .addComponent(jLabel3)
360                            .addComponent(smtptls)
361                            .addComponent(smtps)))
362                    .addComponent(smtphost, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
363                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
364                .addComponent(jButton4)
365                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
366        );
367
368        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("ControlPanel_Userproperties.jPanel4.border.title"))); // NOI18N
369        jPanel4.setName("jPanel4"); // NOI18N
370        jPanel4.setLayout(new java.awt.BorderLayout());
371
372        saveformat.set_Label(bundle.getString("ControlPanel_Userproperties.saveformat._Label")); // NOI18N
373        saveformat.setName("saveformat"); // NOI18N
374        jPanel4.add(saveformat, java.awt.BorderLayout.CENTER);
375
376        jScrollPane1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
377        jScrollPane1.setName("jScrollPane1"); // NOI18N
378
379        jTextPane1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 3, 1));
380        jTextPane1.setText(bundle.getString("ControlPanel_Userproperties.jTextPane1.text")); // NOI18N
381        jTextPane1.setName("jTextPane1"); // NOI18N
382        jTextPane1.setOpaque(false);
383        jScrollPane1.setViewportView(jTextPane1);
384
385        jPanel4.add(jScrollPane1, java.awt.BorderLayout.PAGE_START);
386
387        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("ControlPanel_Userproperties.jPanel10.border.title"))); // NOI18N
388        jPanel10.setName("jPanel10"); // NOI18N
389
390        dtabankid.set_Label(bundle.getString("ControlPanel_Userproperties.dtabankid._Label")); // NOI18N
391        dtabankid.setName("dtabankid"); // NOI18N
392
393        dtabankaccount.set_Label(bundle.getString("ControlPanel_Userproperties.dtabankaccount._Label")); // NOI18N
394        dtabankaccount.setName("dtabankaccount"); // NOI18N
395
396        dtabankname.set_Label(bundle.getString("ControlPanel_Userproperties.dtabankname._Label")); // NOI18N
397        dtabankname.setName("dtabankname"); // NOI18N
398
399        dtabankcountry.set_Label(bundle.getString("ControlPanel_Userproperties.dtabankcountry._Label")); // NOI18N
400        dtabankcountry.setName("dtabankcountry"); // NOI18N
401
402        jLabel4.setText(bundle.getString("ControlPanel_Userproperties.jLabel4.text")); // NOI18N
403        jLabel4.setName("jLabel4"); // NOI18N
404
405        jScrollPane2.setName("jScrollPane2"); // NOI18N
406
407        dtausage0.setText("Invoice from {item.dateadded} ref {item.cnumber}"); // NOI18N
408        dtausage0.setName("dtausage0"); // NOI18N
409        jScrollPane2.setViewportView(dtausage0);
410
411        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
412        jPanel10.setLayout(jPanel10Layout);
413        jPanel10Layout.setHorizontalGroup(
414            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
415            .addGroup(jPanel10Layout.createSequentialGroup()
416                .addContainerGap()
417                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
418                    .addGroup(jPanel10Layout.createSequentialGroup()
419                        .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
420                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
421                        .addComponent(jScrollPane2))
422                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel10Layout.createSequentialGroup()
423                        .addComponent(dtabankid, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE)
424                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
425                        .addComponent(dtabankname, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE))
426                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel10Layout.createSequentialGroup()
427                        .addComponent(dtabankaccount, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE)
428                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
429                        .addComponent(dtabankcountry, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
430                .addContainerGap(122, Short.MAX_VALUE))
431        );
432        jPanel10Layout.setVerticalGroup(
433            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
434            .addGroup(jPanel10Layout.createSequentialGroup()
435                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
436                    .addComponent(dtabankid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
437                    .addComponent(dtabankname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
438                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
439                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
440                    .addComponent(dtabankaccount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
441                    .addComponent(dtabankcountry, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
442                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
443                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
444                    .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 23, Short.MAX_VALUE)
445                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 23, Short.MAX_VALUE))
446                .addContainerGap())
447        );
448
449        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("ControlPanel_Userproperties.jPanel5.border.title"))); // NOI18N
450        jPanel5.setName("jPanel5"); // NOI18N
451        jPanel5.setLayout(new javax.swing.BoxLayout(jPanel5, javax.swing.BoxLayout.Y_AXIS));
452
453        tabs.setText(bundle.getString("ControlPanel_Userproperties.tabs.text")); // NOI18N
454        tabs.setName("tabs"); // NOI18N
455        jPanel5.add(tabs);
456
457        supresscurrencysymbols.setText(bundle.getString("ControlPanel_Userproperties.supresscurrencysymbols.text")); // NOI18N
458        supresscurrencysymbols.setName("supresscurrencysymbols"); // NOI18N
459        jPanel5.add(supresscurrencysymbols);
460
461        ordersoverproducts.setText(bundle.getString("ControlPanel_Userproperties.ordersoverproducts.text")); // NOI18N
462        ordersoverproducts.setName("ordersoverproducts"); // NOI18N
463        jPanel5.add(ordersoverproducts);
464
465        companiesovernames.setText(bundle.getString("ControlPanel_Userproperties.companiesovernames.text")); // NOI18N
466        companiesovernames.setName("companiesovernames"); // NOI18N
467        jPanel5.add(companiesovernames);
468
469        pasten.setText(bundle.getString("ControlPanel_Userproperties.pasten.text")); // NOI18N
470        pasten.setName("pasten"); // NOI18N
471        jPanel5.add(pasten);
472
473        nowarnings.setText(bundle.getString("ControlPanel_Userproperties.nowarnings.text")); // NOI18N
474        nowarnings.setName("nowarnings"); // NOI18N
475        jPanel5.add(nowarnings);
476
477        unpaidbills.setText(bundle.getString("ControlPanel_Userproperties.unpaidbills.text")); // NOI18N
478        unpaidbills.setName("unpaidbills"); // NOI18N
479        jPanel5.add(unpaidbills);
480
481        views.setText(bundle.getString("ControlPanel_Userproperties.views.text")); // NOI18N
482        views.setName("views"); // NOI18N
483        jPanel5.add(views);
484
485        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("ControlPanel_Userproperties.jPanel7.border.title"))); // NOI18N
486        jPanel7.setName("jPanel7"); // NOI18N
487        jPanel7.setLayout(new java.awt.BorderLayout());
488
489        groupl.setFont(groupl.getFont().deriveFont(groupl.getFont().getStyle() | java.awt.Font.BOLD, groupl.getFont().getSize()+1));
490        groupl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
491        groupl.setText(bundle.getString("ControlPanel_Userproperties.groupl.text")); // NOI18N
492        groupl.setName("groupl"); // NOI18N
493        jPanel7.add(groupl, java.awt.BorderLayout.CENTER);
494
495        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
496        jPanel1.setLayout(jPanel1Layout);
497        jPanel1Layout.setHorizontalGroup(
498            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
499            .addGroup(jPanel1Layout.createSequentialGroup()
500                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE)
501                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
502                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, 332, javax.swing.GroupLayout.PREFERRED_SIZE))
503            .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 644, javax.swing.GroupLayout.PREFERRED_SIZE)
504            .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
505            .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
506            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
507            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
508                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, 644, javax.swing.GroupLayout.PREFERRED_SIZE))
509        );
510        jPanel1Layout.setVerticalGroup(
511            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
512            .addGroup(jPanel1Layout.createSequentialGroup()
513                .addGap(50, 50, 50)
514                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
515                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
516                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
517                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, 211, Short.MAX_VALUE)
518                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
519                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
520                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
521                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
522                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
523                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
524                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
525                .addGap(17, 17, 17))
526            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
527                .addGroup(jPanel1Layout.createSequentialGroup()
528                    .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
529                    .addContainerGap(776, Short.MAX_VALUE)))
530        );
531
532        add(jPanel1, java.awt.BorderLayout.CENTER);
533
534        jPanel6.setBackground(new java.awt.Color(255, 255, 255));
535        jPanel6.setName("jPanel6"); // NOI18N
536        jPanel6.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
537
538        jButton2.setText(bundle.getString("ControlPanel_Userproperties.jButton2.text")); // NOI18N
539        jButton2.setName("jButton2"); // NOI18N
540        jButton2.addActionListener(new java.awt.event.ActionListener() {
541            public void actionPerformed(java.awt.event.ActionEvent evt) {
542                jButton2ActionPerformed(evt);
543            }
544        });
545        jPanel6.add(jButton2);
546
547        jButton1.setText(bundle.getString("ControlPanel_Userproperties.jButton1.text")); // NOI18N
548        jButton1.setName("jButton1"); // NOI18N
549        jButton1.addActionListener(new java.awt.event.ActionListener() {
550            public void actionPerformed(java.awt.event.ActionEvent evt) {
551                jButton1ActionPerformed(evt);
552            }
553        });
554        jPanel6.add(jButton1);
555
556        jButton5.setText(bundle.getString("ControlPanel_Userproperties.jButton5.text")); // NOI18N
557        jButton5.setName("jButton5"); // NOI18N
558        jButton5.addActionListener(new java.awt.event.ActionListener() {
559            public void actionPerformed(java.awt.event.ActionEvent evt) {
560                jButton5ActionPerformed(evt);
561            }
562        });
563        jPanel6.add(jButton5);
564
565        add(jPanel6, java.awt.BorderLayout.SOUTH);
566    }// </editor-fold>//GEN-END:initComponents
567
568    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
569
570        setSettings();
571
572    }//GEN-LAST:event_jButton2ActionPerformed
573
574    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
575        setSettings();
576        mpv5.db.objects.User.getCurrentUser().saveProperties();
577        Popup.notice(Messages.RESTART_REQUIRED);
578    }//GEN-LAST:event_jButton1ActionPerformed
579
580    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
581        generate();
582    }//GEN-LAST:event_jButton3ActionPerformed
583
584    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
585        MPControlPanel.instanceOf().openDetails(new ControlPanel_MailTemplates());
586    }//GEN-LAST:event_jButton4ActionPerformed
587
588    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
589        ControlPanel_AdvancedUserProperties c = new ControlPanel_AdvancedUserProperties();
590        MPControlPanel.instanceOf().openDetails(c);
591    }//GEN-LAST:event_jButton5ActionPerformed
592
593    @Override
594    public void setValues(PropertyStore values) {
595        oldvalues = values;
596    }
597
598    @Override
599    public String getUname() {
600        return UNAME;
601    }
602
603    @Override
604    public void reset() {
605        setValues(oldvalues);
606    }
607    // Variables declaration - do not modify//GEN-BEGIN:variables
608    private javax.swing.JCheckBox autorev;
609    private javax.swing.JCheckBox cname;
610    private javax.swing.JCheckBox cnumber;
611    private javax.swing.JCheckBox columnmeasure;
612    private javax.swing.JCheckBox columnquantity;
613    private javax.swing.JCheckBox companiesovernames;
614    private mpv5.ui.beans.LabeledTextField defcount;
615    private javax.swing.JPanel defs;
616    private mpv5.ui.beans.LabeledCombobox deftax;
617    private mpv5.ui.beans.LabeledTextField defunit;
618    private javax.swing.JCheckBox description;
619    private mpv5.ui.beans.LabeledTextField dtabankaccount;
620    private mpv5.ui.beans.LabeledTextField dtabankcountry;
621    private mpv5.ui.beans.LabeledTextField dtabankid;
622    private mpv5.ui.beans.LabeledTextField dtabankname;
623    private javax.swing.JTextPane dtausage0;
624    private javax.swing.JCheckBox ean;
625    private mpv5.ui.beans.LabeledTextField format;
626    private javax.swing.JLabel groupl;
627    private javax.swing.JCheckBox hidediscountcolumn;
628    private javax.swing.JCheckBox hideproductscolumn;
629    private javax.swing.JCheckBox hidetaxcolumn;
630    private javax.swing.JButton jButton1;
631    private javax.swing.JButton jButton2;
632    private javax.swing.JButton jButton3;
633    private javax.swing.JButton jButton4;
634    private javax.swing.JButton jButton5;
635    private javax.swing.JLabel jLabel3;
636    private javax.swing.JLabel jLabel4;
637    private javax.swing.JPanel jPanel1;
638    private javax.swing.JPanel jPanel10;
639    private javax.swing.JPanel jPanel2;
640    private javax.swing.JPanel jPanel3;
641    private javax.swing.JPanel jPanel4;
642    private javax.swing.JPanel jPanel5;
643    private javax.swing.JPanel jPanel6;
644    private javax.swing.JPanel jPanel7;
645    private javax.swing.JPanel jPanel9;
646    private javax.swing.JScrollPane jScrollPane1;
647    private javax.swing.JScrollPane jScrollPane2;
648    private javax.swing.JTextPane jTextPane1;
649    private javax.swing.JCheckBox nowarnings;
650    private javax.swing.JCheckBox ordersoverproducts;
651    private javax.swing.JCheckBox pasten;
652    private javax.swing.JPanel productstobillsproperties;
653    private javax.swing.JCheckBox reference;
654    private mpv5.ui.beans.LabeledTextField saveformat;
655    private mpv5.ui.beans.LabeledCombobox shiptax;
656    private javax.swing.JCheckBox showoptionalcolumn;
657    private mpv5.ui.beans.LabeledTextField smtphost;
658    private javax.swing.JPasswordField smtppw;
659    private javax.swing.JCheckBox smtps;
660    private javax.swing.JCheckBox smtptls;
661    private mpv5.ui.beans.LabeledTextField smtpuser;
662    private javax.swing.JCheckBox supresscurrencysymbols;
663    private javax.swing.JCheckBox tabs;
664    private javax.swing.JCheckBox unpaidbills;
665    private javax.swing.JCheckBox views;
666    // End of variables declaration//GEN-END:variables
667
668    private void setSettings() {
669
670        if (format.getText().length() == 0) {
671            generate();
672        }
673        try {
674            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty(Context.getProduct() + LightMPComboBox.VALUE_SEARCHFIELDS, format.getText());
675            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty(defcount.getName(), defcount.getText());
676            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty(defunit.getName(), defunit.getText());
677            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty(saveformat.getName(), saveformat.getText().replace("\\", "/"));
678//            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty(savedir.getName(), savedir.get_Text(false));
679            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "norecycletabs", tabs.isSelected());
680            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "avoidmultipleviews", views.isSelected());
681            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "hidecolumnquantity", columnquantity.isSelected());
682            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "hideproductscolumn", hideproductscolumn.isSelected());
683            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "hidecolumnmeasure", columnmeasure.isSelected());
684            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "hidetaxcolumn", hidetaxcolumn.isSelected());
685            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "hidediscountcolumn", hidediscountcolumn.isSelected());
686            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "showoptionalcolumn", showoptionalcolumn.isSelected());
687            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "supresscurrencysymbols", supresscurrencysymbols.isSelected());
688            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "autocreaterevenue", autorev.isSelected());
689            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "ordersoverproducts", ordersoverproducts.isSelected());
690            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "companiesovernames", companiesovernames.isSelected());
691            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "pasten", pasten.isSelected());
692            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "nowarnings", nowarnings.isSelected());
693            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("org.openyabs.uiproperty", "propertiesdefined", true);
694
695            if (deftax.getSelectedItem() != null) {
696                mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty(deftax.getName(), deftax.getSelectedItem().getId());
697            }
698            if (shiptax.getSelectedItem() != null) {
699                mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty(shiptax.getName(), shiptax.getSelectedItem().getId());
700            }
701            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("smtp.host", smtphost.getText());
702            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("smtp.host.user", smtpuser.getText());
703            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("smtp.host.password", new String(smtppw.getPassword()));
704            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("smtp.host.usetls", Boolean.toString(smtptls.isSelected()));
705            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("smtp.host.usesmpts", Boolean.toString(smtps.isSelected()));
706
707            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("dtabankaccount", dtabankaccount.getText());
708            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("dtabankid", dtabankid.getText());
709            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("dtabankname", dtabankname.getText());
710            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("dtabankcountry", dtabankcountry.getText());
711            mpv5.db.objects.User.getCurrentUser().getProperties().changeProperty("dtausage0", dtausage0.getText());
712
713            mpv5.db.objects.User.getCurrentUser().defineMailConfig();
714            mpv5.db.objects.User.getCurrentUser().defineDTAConfig();
715        } catch (Exception e) {
716            Log.Debug(e);
717        }
718        loadSettings();
719    }
720
721    @Override
722    public Component getAndRemoveActionPanel() {
723        this.remove(jPanel6);
724        validate();
725        return jPanel6;
726    }
727
728    private void loadSettings() {
729        tabs.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "norecycletabs"));
730        nowarnings.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "nowarnings"));
731        views.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "avoidmultipleviews"));
732        unpaidbills.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "hideunpaidbills"));
733        columnquantity.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "hidecolumnquantity"));
734        columnmeasure.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "hidecolumnmeasure"));
735        hideproductscolumn.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "hideproductscolumn"));
736        showoptionalcolumn.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "showoptionalcolumn"));
737        supresscurrencysymbols.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "supresscurrencysymbols"));
738        autorev.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "autocreaterevenue"));
739        ordersoverproducts.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "ordersoverproducts"));
740        companiesovernames.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "companiesovernames"));
741        hidetaxcolumn.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "hidetaxcolumn"));
742        pasten.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "pasten"));
743        dtabankaccount.setText(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("dtabankaccount"));
744        dtabankid.setText(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("dtabankid"));
745        dtabankname.setText(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("dtabankname"));
746        dtabankcountry.setText(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("dtabankcountry"));
747        dtausage0.setText(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("dtausage0"));
748        hidediscountcolumn.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("org.openyabs.uiproperty", "hidediscountcolumn"));
749
750        Component[] t = productstobillsproperties.getComponents();
751        for (int i = 0; i < t.length; i++) {
752            Component component = t[i];
753            if (mpv5.db.objects.User.getCurrentUser().getProperties().hasProperty(Context.getProduct() + LightMPComboBox.VALUE_SEARCHFIELDS)) {
754                if (component instanceof JCheckBox) {
755                    try {
756                        ((JCheckBox) component).setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty(Context.getProduct() + LightMPComboBox.VALUE_SEARCHFIELDS).contains(component.getName()));
757                    } catch (Exception e) {
758                    }
759                }
760            }
761        }
762        String s = mpv5.db.objects.User.getCurrentUser().getProperties().getProperty(Context.getProduct() + LightMPComboBox.VALUE_SEARCHFIELDS);
763        if (s != null) {
764            format.setText(s);
765        } else {
766            format.setText("_$cname$_ ");
767        }
768
769        String s1 = mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("saveformat");
770        if (s1 != null) {
771            saveformat.setText(s1);
772        } else {
773            format.setText("");
774        }
775
776//        String s2 = mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("savedir");
777//        if (s2 != null) {
778//            savedir.set_Text(s2);
779//        } else {
780//            savedir.set_Text("");
781//        }
782
783        if (mpv5.db.objects.User.getCurrentUser().getProperties().hasProperty(defcount.getName())) {
784            defcount.setText(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty(defcount.getName()));
785        } else {
786            defcount.setText("1");
787        }
788
789        if (mpv5.db.objects.User.getCurrentUser().getProperties().hasProperty(defcount.getName())) {
790            defcount.setText(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty(defcount.getName()));
791        } else {
792            defcount.setText("1");
793        }
794
795        if (mpv5.db.objects.User.getCurrentUser().getProperties().hasProperty("smtp.host")) {
796            smtphost.setText(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("smtp.host"));
797        }
798
799        if (mpv5.db.objects.User.getCurrentUser().getProperties().hasProperty("smtp.host.user")) {
800            smtpuser.setText(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("smtp.host.user"));
801        }
802
803        if (mpv5.db.objects.User.getCurrentUser().getProperties().hasProperty("smtp.host.password")) {
804            smtppw.setText(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("smtp.host.password"));
805        }
806
807        if (mpv5.db.objects.User.getCurrentUser().getProperties().hasProperty("smtp.host.usetls")) {
808            smtptls.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("smtp.host.usetls", false));
809        }
810
811        if (mpv5.db.objects.User.getCurrentUser().getProperties().hasProperty("smtp.host.usesmpts")) {
812            smtps.setSelected(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty("smtp.host.usesmpts", false));
813        }
814
815        try {
816            Runnable runnable = new Runnable() {
817
818                public void run() {
819                    try {
820                        deftax.setSelectedItem(Integer.valueOf(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty(deftax.getName())));
821                    } catch (NumberFormatException numberFormatException) {
822                    }
823                    try {
824                        shiptax.setSelectedItem(Integer.valueOf(mpv5.db.objects.User.getCurrentUser().getProperties().getProperty(shiptax.getName())));
825                    } catch (NumberFormatException numberFormatException) {
826                    }
827                }
828            };
829            SwingUtilities.invokeLater(runnable);
830        } catch (Exception e) {
831        }
832
833    }
834
835    private void generate() {
836        Component[] t = productstobillsproperties.getComponents();
837        String h = "";
838        for (int i = 0; i < t.length; i++) {
839            Component component = t[i];
840            if (component instanceof JCheckBox) {
841                if (((JCheckBox) component).isSelected()) {
842                    h += "_$" + component.getName() + "$_ ";
843                }
844            }
845        }
846        format.setText(h);
847    }
848}