Mark2020H

Header Part 1 GUI QT SSH Generator More to follow

May 22nd, 2023
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.39 KB | None | 0 0
  1. /* This  code is  delivered in 4 or more parts and provides a  GUI mechanism  for  generating ssh keys using QT  C++
  2.  * For Debian 12  65 bit The entire project can also be downloaded  via  GIT-HUB for this whom want to know more and  would  
  3.  * Like to  re compile or gain  ideas as to how to do some of this
  4.  * All instructions plus  pre compiled code for  Debian 12  are available at git-hub  
  5.  * @ this address https://github.com/markh2016/GUISSHGenerator.git
  6.  * This is Part 1  The header file  MD Harrington London UK 22/05/2023
  7. */
  8.    
  9.  
  10.  
  11.  
  12. #ifndef DIALOG_H
  13. #define DIALOG_H
  14.  
  15. #include <QDialog> // required for the dialog from
  16. #include <QDir>   // for obtaining info about current  working directories or  setting these
  17. #include <QDebug> //  fro debug   output
  18. #include <QHash> // this is for key value pairs
  19. #include <QMessageBox>  // eny message that  we wanty to display
  20. #include <QRegularExpression>  // for  regex expressions
  21. #include <QSettings>
  22. #include <QFile>
  23. #include <QProcess>
  24.  
  25.  
  26. QT_BEGIN_NAMESPACE
  27. namespace Ui { class Dialog; }
  28. QT_END_NAMESPACE
  29.  
  30. class Dialog : public QDialog
  31. {
  32.     Q_OBJECT
  33.  
  34. public:
  35.     Dialog(QWidget *parent = nullptr);
  36.     ~Dialog();
  37.  
  38. private:
  39.     Ui::Dialog *ui;  // the UI  xml file itself
  40.     QString *eml ; // Pointer to email address
  41.     QString *paswrd ; // Pointer to  password
  42.     QString file_path , file_name;
  43.     QProcess *process , *addProcess, *addProcess2, *process2 ; // for creating ssh process ;
  44.     QString commands ;  // for  sending commands to underlying terminal
  45.     QString output ;  //  for  anyoutput obtained from  signal slot defininition of
  46.     // connect(process,&QProcess::readyReadStandardError
  47.  
  48.     QString homedir ; // for setting home directory
  49.  
  50.     bool isLoaded ; // flag for ensuring we have either saved details or loaded details from INI  file
  51.  
  52.      //  create so that we dont have to  continously use  QMessagebox in every function where required
  53.  
  54.     void showMessage(const QString &message , const QString &title , const int &msgtype) ;
  55.  
  56.     void saveSettings () ; // save  settings of pass and user email
  57.  
  58.     bool checkSSHKeyFilesExist() ;
  59.  
  60.  
  61.  
  62. private slots :
  63.     void saveDetails() ;
  64.     void loadDetials() ;
  65.     void handleClose () ;
  66.     void processStartProcess() ;
  67.     void writeCommands() ;
  68.     void addKeyToAgent() ;
  69.     void showSSK_Key() ;
  70.     void addKeyToGit();
  71.  
  72. };
  73. #endif // DIALOG_H
  74.  
Add Comment
Please, Sign In to add comment