| 1 | /* |
| 2 | * File: mainwindow.h |
| 3 | * |
| 4 | * Author: Jacob Dekel |
| 5 | * Created on: Aug 7, 2009 |
| 6 | * |
| 7 | * Copyright (c) 2009-2013 Jacob Dekel |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Main window object |
| 11 | * |
| 12 | * This program is free software: you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by |
| 14 | * the Free Software Foundation, either version 3 of the License, or |
| 15 | * (at your option) any later version. |
| 16 | * |
| 17 | * This program is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | * GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License |
| 23 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 24 | * |
| 25 | */ |
| 26 | |
| 27 | #ifndef MAINWINDOW_H |
| 28 | #define MAINWINDOW_H |
| 29 | |
| 30 | #include <QtWidgets/QMainWindow> |
| 31 | #include "HerculesStudio.h" |
| 32 | #include "ui_MainWindow.h" |
| 33 | #include "MainPanel.h" |
| 34 | #include "DevicesPane.h" |
| 35 | #include "CommandLine.h" |
| 36 | #include "Psw.h" |
| 37 | #include "Regs32.h" |
| 38 | #include "Regs64.h" |
| 39 | #include "HerculesExecutor.h" |
| 40 | #include "LogRunner.h" |
| 41 | #include "StatusRunner.h" |
| 42 | #include "Preferences.h" |
| 43 | #include "Watchdog.h" |
| 44 | |
| 45 | #include "ConfigFile.h" |
| 46 | #include "Configuration.h" |
| 47 | #include <QTextEdit> |
| 48 | #include <QSystemTrayIcon> |
| 49 | #include <QWaitCondition> |
| 50 | |
| 51 | class LogRunner; |
| 52 | class HerculesExecutor; |
| 53 | class PlainLogWidget; |
| 54 | class PrinterDialog; |
| 55 | |
| 56 | class MainWindow : public QMainWindow |
| 57 | { |
| 58 | Q_OBJECT |
| 59 | |
| 60 | public: |
| 61 | MainWindow(QWidget *parent = 0); |
| 62 | virtual ~MainWindow(); |
| 63 | |
| 64 | bool issueCommand(const std::string& command); |
| 65 | ConfigFile * getConfigurationFile(); |
| 66 | |
| 67 | private: |
| 68 | Ui::MainWindowClass ui; |
| 69 | QDockWidget * mTopDock; |
| 70 | QDockWidget * mDevicesDock; |
| 71 | QDockWidget * mBottomDock; |
| 72 | QDockWidget * mGRegisters32Dock; |
| 73 | QDockWidget * mCRegisters32Dock; |
| 74 | QDockWidget * mFRegisters32Dock; |
| 75 | QDockWidget * mARegisters32Dock; |
| 76 | QDockWidget * mGRegisters64Dock; |
| 77 | QDockWidget * mCRegisters64Dock; |
| 78 | QDockWidget * mFRegisters64Dock; |
| 79 | QDockWidget * mPswDock; |
| 80 | |
| 81 | Configuration * mConfiguration; |
| 82 | ConfigFile * mConfigFile; |
| 83 | PlainLogWidget * mLogWindow; |
| 84 | QSystemTrayIcon * mSystemTrayIcon; |
| 85 | MainPanel * mMainPanel; |
| 86 | DevicesPane * mDevicesPane; |
| 87 | CommandLine * mCommandLine; |
| 88 | Psw * mPsw; |
| 89 | Regs32 * mGRegisters32; |
| 90 | Regs32 * mCRegisters32; |
| 91 | Regs32 * mFRegisters32; |
| 92 | Regs32 * mARegisters32; |
| 93 | Regs64 * mGRegisters64; |
| 94 | Regs64 * mCRegisters64; |
| 95 | Regs64 * mFRegisters64; |
| 96 | SynchronizedQueue mLogQueue; |
| 97 | SynchronizedQueue mStatusQueue; |
| 98 | HerculesExecutor * mHerculesExecutor; |
| 99 | LogRunner * mLogRunner; |
| 100 | StatusRunner * mStatusRunner; |
| 101 | Watchdog * mWatchdog; |
| 102 | PrinterDialog * mPrinterDialog; |
| 103 | bool mHerculesActive; |
| 104 | bool mMinimizeOnClose; |
| 105 | bool mRecovery; |
| 106 | bool mDevicesRecovery; |
| 107 | bool mDevicesRecoveryCommenced; |
| 108 | bool mSystrayHintEjected; |
| 109 | bool mStatusReceived; |
| 110 | QString mRecoveryConfig; |
| 111 | QString mCurrentPath; |
| 112 | QString mAdHocLoadParm; |
| 113 | QString mIplDevno; |
| 114 | |
| 115 | void testGui(); |
| 116 | void connectMainPanel(); |
| 117 | void fontChanged(); |
| 118 | void mipsChanged(); |
| 119 | void pswChanged(); |
| 120 | void styleChanged(); |
| 121 | void themeChanged(); |
| 122 | void setIpled(QString ipled); |
| 123 | void setDarkBackground(bool dark); |
| 124 | |
| 125 | |
| 126 | public slots: |
| 127 | void powerOn(); |
| 128 | void powerOff(); |
| 129 | void extInterrupt(); |
| 130 | void devInterrupt(); |
| 131 | void load(); |
| 132 | void restart(); |
| 133 | void store(); |
| 134 | void start(); |
| 135 | void stop(); |
| 136 | void restartDevices(); |
| 137 | |
| 138 | // menu-related slots |
| 139 | void newConfig(); |
| 140 | void config(); |
| 141 | void saveConfig(); |
| 142 | void saveConfigAs(); |
| 143 | void openConfig(); |
| 144 | void exitNow(); |
| 145 | void loadCommand(); |
| 146 | void editViewControls(); |
| 147 | void editViewDevices(); |
| 148 | void editViewCommand(); |
| 149 | void editView32BitGr(); |
| 150 | void editView32BitCr(); |
| 151 | void editView32BitFr(); |
| 152 | void editView32BitAr(); |
| 153 | void editView64BitGr(); |
| 154 | void editView64BitCr(); |
| 155 | void editView64BitFr(); |
| 156 | void editViewPSW(); |
| 157 | void dasdinit(); |
| 158 | void dasdload(); |
| 159 | void dasdisup(); |
| 160 | void dasdls(); |
| 161 | void dasdcat(); |
| 162 | void dasdconv(); |
| 163 | void dasdcopy(); |
| 164 | void tapemap(); |
| 165 | void tapecopy(); |
| 166 | void tapesplit(); |
| 167 | void hetinit(); |
| 168 | void hetget(); |
| 169 | void hetupd(); |
| 170 | void hetmap(); |
| 171 | void printer(); |
| 172 | void printerFinished(); |
| 173 | void stationery(); |
| 174 | void decolation(); |
| 175 | void helpAbout(); |
| 176 | |
| 177 | void writeToLogFromQueue(); |
| 178 | void writeToLog(QByteArray line); |
| 179 | void preferencesChanged(); |
| 180 | void dispatchStatus(); |
| 181 | void newCommand(); |
| 182 | void herculesEndedSlot(); |
| 183 | void editCopy(); |
| 184 | void deleteMessages(); |
| 185 | void saveMessages(); |
| 186 | void preferences(); |
| 187 | void closeEvent(QCloseEvent * event); |
| 188 | void tryAbort(); |
| 189 | void systrayClick(QSystemTrayIcon::ActivationReason); |
| 190 | void hideRestore(); |
| 191 | void systrayHint(); |
| 192 | void recoverDevices(QByteArray& statusLine); |
| 193 | void keyPressEvent(QKeyEvent * event); |
| 194 | }; |
| 195 | |
| 196 | #endif // MAINWINDOW_H |