File indexing completed on 2024-04-28 15:35:03

0001 /***************************************************************************
0002                           dlgappsettings.h  -  application settings
0003     This file is a part of KMuddy distribution.
0004                              -------------------
0005     begin                : St aug 14 2002
0006     copyright            : (C) 2002 by Tomas Mecir
0007     email                : kmuddy@kmuddy.com
0008  ***************************************************************************/
0009 
0010 /***************************************************************************
0011  *                                                                         *
0012  *   This program is free software; you can redistribute it and/or modify  *
0013  *   it under the terms of the GNU General Public License as published by  *
0014  *   the Free Software Foundation; either version 2 of the License, or     *
0015  *   (at your option) any later version.                                   *
0016  *                                                                         *
0017  ***************************************************************************/
0018 
0019 #ifndef DLGAPPSETTINGS_H
0020 #define DLGAPPSETTINGS_H
0021 
0022 
0023 #include <qfont.h>
0024 #include <kpagedialog.h>
0025 
0026 class QLabel;
0027 class QComboBox;
0028 class QCheckBox;
0029 class QLineEdit;
0030 class QSpinBox;
0031 class KColorButton;
0032 class KShortcutsEditor;
0033 class cDirList;
0034 
0035 //TODO: constructor is a bit TOO complicated & long - should be splitted
0036 //into more functions (1 function per page)!!!
0037 
0038 /**
0039 Dialog with main application settings.
0040 
0041   *@author Tomas Mecir
0042   */
0043 
0044 class dlgAppSettings : public KPageDialog  {
0045    Q_OBJECT
0046 public: 
0047   dlgAppSettings(QWidget *parent=nullptr);
0048   ~dlgAppSettings() override;
0049 
0050   QSize sizeHint() const override;
0051 
0052 //functions to get/set values
0053 //Window
0054   bool alwaysTabBar ();
0055   void setAlwaysTabBar (bool value);
0056   bool auxInput ();
0057   void setAuxInput (bool val);
0058   bool alwaysNotify ();
0059   void setAlwaysNotify (bool value);
0060   bool localNotify ();
0061   void setLocalNotify (bool value);
0062   bool globalNotify ();
0063   void setGlobalNotify (bool value);
0064   bool sysTrayEnabled ();
0065   bool passivePopup ();
0066   void setSysTrayEnabled (bool value);
0067   void setPassivePopup(bool value);
0068   QString autoConnect ();
0069   void setAutoConnect (const QString &ac);
0070 
0071 //Output area
0072   int getcolorindex (int which);
0073   void setcolorindex (int which, int value);
0074   bool cmdEcho ();
0075   bool messages ();
0076   void setCmdEcho (bool value);
0077   void setMessages (bool value);
0078   bool enableBlinking ();
0079   void setEnableBlinking (bool value);
0080   void setIndentation (int value);
0081   int indentation ();
0082   void setHistory (int value);
0083   int history ();
0084   
0085 //Font
0086   void setFont1 (QFont f);
0087   void setFont2 (QFont f);
0088   void setFont3 (QFont f);
0089   QFont font1 ();
0090   QFont font2 ();
0091   QFont font3 ();
0092 
0093 //Inputline
0094   bool keeptext ();
0095   bool selectkepttext ();
0096   bool arrowsHistory ();
0097   bool autocompletion ();
0098   int actype ();
0099   void setKeepText (bool value);
0100   void setSelectKeptText (bool value);
0101   void setArrowsHistory (bool value);
0102   void setAutoCompletion (bool value);
0103   void setACType (int value);
0104   bool telnetPaste ();
0105   void setTelnetPaste (bool value);
0106   bool trimSpaces ();
0107   void setTrimSpaces (bool value);
0108   int inputbkcolor ();
0109   int inputcolor ();
0110   void setInputBkColor (int value);
0111   void setInputColor (int value);
0112   bool swapEnters ();
0113   void setSwapEnters (bool value);
0114 
0115 //Colors
0116   void setColor (int i, QColor color);
0117   QColor color (int i);
0118   
0119 //Characters
0120   QString cmdseparator ();
0121   QString speedwalk ();
0122   QString script ();
0123   QString multicmd ();
0124   QString focus ();
0125   QString noParse ();
0126   void setCmdSeparator (QString what);
0127   void setSpeedWalk (QString what);
0128   void setScript (QString what);
0129   void setMultiCmd (QString what);
0130   void setFocusCmd (QString what);
0131   void setNoParse (QString what);
0132 
0133   bool allowEmptyWalkStr ();
0134   bool expandBS ();
0135   void setAllowEmptyWalkStr (bool val);
0136   void setExpandBS (bool val);
0137 
0138 //MSP
0139   const QStringList &soundDirs ();
0140   bool allowMSP ();
0141   bool allowDownloads ();
0142   void setSoundDirs (const QStringList &list);
0143   void setAllowMSP (bool val);
0144   void setAllowDownloads (bool val);
0145 
0146   /** put settings to the dialog */
0147   void putSettingsToDialog ();
0148 
0149 protected:
0150 
0151 //Window
0152   QCheckBox *chkalwaystabbar, *chkauxinput;
0153   QCheckBox *chkalwaysnotify, *chkglobalnotify, *chklocalnotify;
0154   QCheckBox *chkautoconnect;
0155   QComboBox *autoconnect;
0156   QCheckBox *chksystray;
0157   QCheckBox *chkpassivepopup;
0158 //Output area
0159   QComboBox *combo[4];
0160   QCheckBox *chkcmdecho, *chkmessages;
0161   QCheckBox *chkblinking;
0162   QSpinBox *edindent, *edhistory;
0163 //Font
0164   QLabel *fonted1, *fonted2, *fonted3;
0165   QFont font[3];
0166 //Inputline
0167   QCheckBox *chkkeeptext, *chkselectkepttext, *chkautocompletion;
0168   QCheckBox *chkarrowshistory;
0169   QCheckBox *chktelnetpaste;
0170   QCheckBox *chktrimspaces;
0171   QCheckBox *chkswapenters;
0172   QComboBox *comboactype, *comboinputbkcolor, *comboinputcolor;
0173 //Colors
0174   KColorButton *cbutton[16];
0175 //Characters
0176   QLineEdit *edcmdseparator, *edspeedwalk, *edscript, *edmulticmd, *edfocus, *ednoparse;
0177   QCheckBox *chkemptywalk, *chkexpandBS;
0178 //MSP
0179   QCheckBox *chkallowmsp, *chkallowdownloads;
0180   cDirList *dirlist;
0181 
0182 //Shortcuts
0183   KShortcutsEditor *keys;
0184 protected slots:
0185   void fontchooser1 ();
0186   void fontchooser2 ();
0187   void fontchooser3 ();
0188   void getSettingsFromDialog ();
0189 };
0190 
0191 #endif