| 1 | /* |
| 2 | * File: LogsWidget.cpp |
| 3 | * |
| 4 | * Author: Jacob Dekel |
| 5 | * Created on: July 1, 2010 |
| 6 | * |
| 7 | * Copyright (c) 2010 Jacob Dekel |
| 8 | * $Id: |
| 9 | * |
| 10 | * This program is free software: you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation, either version 3 of the License, or |
| 13 | * (at your option) any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | * |
| 23 | */ |
| 24 | |
| 25 | #include "LogWidget.h"cxx . . $ `<file>/HercStudio/LogWidget.h`/ |
| 26 | #include "Preferences.h"cxx . . $ `<file>/HercStudio/Preferences.h`/ |
| 27 | #include "HerculesStudio.h"cxx . . $ `<file>/HercStudio/HerculesStudio.h`/ |
| 28 | |
| 29 | #include <QTabWidget> |
| 30 | #include <QFile> |
| 31 | #include <QTextBlock> |
| 32 | #include <QTextStream> |
| 33 | #include <QClipboard> |
| 34 | #include <QApplication> |
| 35 | |
| 36 | #include <fcntl.h> |
| 37 | #include <time.h> |
| 38 | #ifndef hFramework |
| 39 | #include <sys/time.h> |
| 40 | #endif |
| 41 | |
| 42 | |
| 43 | #define for_each_logcxx . . $ `HercStudio/LogWidget.cpp:43:9`! \ |
| 44 | for (int for_loop_i=0; for_loop_i<2; for_loop_i++) |
| 45 | #define current_logcxx . . $ `HercStudio/LogWidget.cpp:45:9`! mLogs[for_loop_i] |
| 46 | |
| 47 | PlainLogWidgetcxx . . $ PlainLogWidget#::PlainLogWidgetcxx . . $ PlainLogWidget#PlainLogWidget(d4d784ff5f449b0d).(QWidgetcxx . . $ QWidget# * parent, const char * suffix) |
| 48 | :QTextEditcxx . . $ QTextEdit#(parent), mGreencxx . . $ PlainLogWidget#mGreen.(10,120,10), mYellowcxx . . $ PlainLogWidget#mYellow.(215,201,45), mRedcxx . . $ PlainLogWidget#mRed.(240,20,20), mBlackcxx . . $ PlainLogWidget#mBlack.(0,0,0), mWhitecxx . . $ PlainLogWidget#mWhite.(250,250,250), mLinesWrittencxx . . $ PlainLogWidget#mLinesWritten.(0) |
| 49 | { |
| 50 | mSaveLogcxx . . $ PlainLogWidget#mSaveLog. = Preferencescxx . . $ Preferences#::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).().autosaveLogcxx . . $ Preferences#autosaveLog(50ce9a9e25b4a850).(); |
| 51 | mLogFileLinescxx . . $ PlainLogWidget#mLogFileLines. = Preferencescxx . . $ Preferences#::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).().logFileLinescxx . . $ Preferences#logFileLines(455f465bc33b4cdf).(); |
| 52 | QStringcxx . . $ QString# parmcxx . . $ QString#QString(85c52e162fed56f9).(suffix); |
| 53 | setLogFileNamecxx . . $ PlainLogWidget#setLogFileName(4c89b026053e4d32).(parm); |
| 54 | mIpledcxx . . $ PlainLogWidget#mIpled. = false; |
| 55 | mDarkBackgroundcxx . . $ PlainLogWidget#mDarkBackground. = Preferencescxx . . $ Preferences#::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).().darkBackgroundcxx . . $ Preferences#darkBackground(50ce9a9e25b4a850).(); |
| 56 | |
| 57 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(copyAvailable(bool)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(keepSelection(bool))); |
| 58 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(logCopy()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(copy())); |
| 59 | } |
| 60 | |
| 61 | void PlainLogWidgetcxx . . $ PlainLogWidget#::setLogFileNamecxx . . $ PlainLogWidget#setLogFileName(4c89b026053e4d32). (QStringcxx . . $ QString#& suffix) |
| 62 | { |
| 63 | getTimeStampcxx . . $ PlainLogWidget#getTimeStamp(b45ddcbc8423892c).(true); |
| 64 | mLogFileNamecxx . . $ PlainLogWidget#mLogFileName. =cxx . . $ QString#`operator=`(d02845eef0c33901). Preferencescxx . . $ Preferences#::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).().logsDircxx . . $ Preferences#logsDir(219584694fe2b248).().c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(); |
| 65 | mLogFileNamecxx . . $ PlainLogWidget#mLogFileName. +=cxx . . $ QString#`operator+=`(d02845eef0c33901). "/hercules"; |
| 66 | mLogFileNamecxx . . $ PlainLogWidget#mLogFileName. +=cxx . . $ QString#`operator+=`(d02845eef0c33901). mTimeStampcxx . . $ PlainLogWidget#mTimeStamp.; |
| 67 | if (suffix.lengthcxx . . $ QString#length(455f465bc33b4cdf).() != 0) |
| 68 | { |
| 69 | mLogFileNamecxx . . $ PlainLogWidget#mLogFileName. +=cxx . . $ QString#`operator+=`(d02845eef0c33901). "."; |
| 70 | mLogFileNamecxx . . $ PlainLogWidget#mLogFileName. +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). suffix; |
| 71 | } |
| 72 | mLogFileNamecxx . . $ PlainLogWidget#mLogFileName. +=cxx . . $ QString#`operator+=`(d02845eef0c33901). ".log"; |
| 73 | } |
| 74 | |
| 75 | void PlainLogWidgetcxx . . $ PlainLogWidget#::appendcxx . . $ PlainLogWidget#append(45672f3c6961a244).(const QByteArraycxx . . $ QByteArray# & text) |
| 76 | { |
| 77 | if (Preferencescxx . . $ Preferences#::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).().logTimestampcxx . . $ Preferences#logTimestamp(50ce9a9e25b4a850).()) |
| 78 | { |
| 79 | getTimeStampcxx . . $ PlainLogWidget#getTimeStamp(b45ddcbc8423892c).(false); |
| 80 | } |
| 81 | else |
| 82 | mTimeStampcxx . . $ PlainLogWidget#mTimeStamp.[0] = '\0'; |
| 83 | QByteArraycxx . . $ QByteArray# s = textcxx . . $ QByteArray#QByteArray(45672f3c6961a244).; |
| 84 | if (text.datacxx . . $ QByteArray#data(a9f41ea0e82d88cf).()[0] == '<') |
| 85 | s =cxx . . $ QByteArray#`operator=`(d0b0ff031ded1fc3). text.midcxx . . $ QByteArray#mid(7d967001c4837235).(24); |
| 86 | |
| 87 | QColorcxx . . $ QColor# keepC = textColorcxx . . $ QColor#QColor(c2a45ff37f9550ed).(); |
| 88 | |
| 89 | if (mDarkBackgroundcxx . . $ PlainLogWidget#mDarkBackground.) |
| 90 | { |
| 91 | if (strncmp(text.datacxx . . $ QByteArray#data(a9f41ea0e82d88cf).(),"HHC",3) == 0) |
| 92 | { |
| 93 | if (text[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).8] == 'I') |
| 94 | setTextColorcxx . . $ QTextEdit#setTextColor(129a55e114526ad3).(mGreencxx . . $ PlainLogWidget#mGreen.); |
| 95 | else if (text.midcxx . . $ QByteArray#mid(7d967001c4837235).(8,1) ==cxx . . $ `operator==`(d346cf23d885fffb)."W") |
| 96 | setTextColorcxx . . $ QTextEdit#setTextColor(129a55e114526ad3).(mYellowcxx . . $ PlainLogWidget#mYellow.); |
| 97 | else if (text.midcxx . . $ QByteArray#mid(7d967001c4837235).(8,1) ==cxx . . $ `operator==`(d346cf23d885fffb)."E") |
| 98 | setTextColorcxx . . $ QTextEdit#setTextColor(129a55e114526ad3).(mRedcxx . . $ PlainLogWidget#mRed.); |
| 99 | } |
| 100 | else |
| 101 | setTextColorcxx . . $ QTextEdit#setTextColor(129a55e114526ad3).(mWhitecxx . . $ PlainLogWidget#mWhite.); |
| 102 | |
| 103 | } |
| 104 | else |
| 105 | { |
| 106 | if (strncmp(text.datacxx . . $ QByteArray#data(a9f41ea0e82d88cf).(),"HHC",3) == 0) |
| 107 | { |
| 108 | if (text[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).8] == 'I') |
| 109 | setTextColorcxx . . $ QTextEdit#setTextColor(129a55e114526ad3).(mGreencxx . . $ PlainLogWidget#mGreen.); |
| 110 | else if (text.midcxx . . $ QByteArray#mid(7d967001c4837235).(8,1) ==cxx . . $ `operator==`(d346cf23d885fffb)."W") |
| 111 | setTextColorcxx . . $ QTextEdit#setTextColor(129a55e114526ad3).(mYellowcxx . . $ PlainLogWidget#mYellow.); |
| 112 | else if (text.midcxx . . $ QByteArray#mid(7d967001c4837235).(8,1) ==cxx . . $ `operator==`(d346cf23d885fffb)."E") |
| 113 | setTextColorcxx . . $ QTextEdit#setTextColor(129a55e114526ad3).(mRedcxx . . $ PlainLogWidget#mRed.); |
| 114 | } |
| 115 | else |
| 116 | setTextColorcxx . . $ QTextEdit#setTextColor(129a55e114526ad3).(mBlackcxx . . $ PlainLogWidget#mBlack.); |
| 117 | } |
| 118 | int len = s.lengthcxx . . $ QByteArray#length(455f465bc33b4cdf).()-1; |
| 119 | if (s[cxx . . $ QByteArray#`operator[]`(6eaff86c84670f1a).len] ==cxx . . $ QByteRef#`operator==`(aec1b1cad4a17585). '\n') s[cxx . . $ QByteArray#`operator[]`(6eaff86c84670f1a).len] =cxx . . $ QByteRef#`operator=`(fee4eda3ac0bfad3). '\0'; |
| 120 | QTextEditcxx . . $ QTextEdit#::appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(QByteArraycxx . . $ QString#QString(45672f3c6961a244).(mTimeStampcxx . . $ PlainLogWidget#mTimeStamp.) +cxx . . $ operator+(49e2485dc0bda598). s); |
| 121 | setTextColorcxx . . $ QTextEdit#setTextColor(129a55e114526ad3).(keepC); |
| 122 | if (QTextEditcxx . . $ QTextEdit#::documentcxx . . $ QTextEdit#document(f21741221844491e).()->blockCountcxx . . $ QTextDocument#blockCount(455f465bc33b4cdf).()%mLogFileLinescxx . . $ PlainLogWidget#mLogFileLines. == 0) |
| 123 | { |
| 124 | writeToFilecxx . . $ PlainLogWidget#writeToFile(c5c4b58b43b7b49).(Overflowcxx . . $ PlainLogWidget#Overflow.); |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | void PlainLogWidgetcxx . . $ PlainLogWidget#::getTimeStampcxx . . $ PlainLogWidget#getTimeStamp(b45ddcbc8423892c).(bool withDate) |
| 129 | { |
| 130 | struct tmcxx . . $ tm# *current; |
| 131 | time_t now; |
| 132 | time(&now); |
| 133 | current = localtime(&now); |
| 134 | |
| 135 | if (withDate) |
| 136 | strftime(mTimeStampcxx . . $ PlainLogWidget#mTimeStamp., 255, "%Y-%m-%d-%H-%M-%S", current); |
| 137 | else |
| 138 | { |
| 139 | strftime(mTimeStampcxx . . $ PlainLogWidget#mTimeStamp., 255, "%H:%M:%S", current); //"%m-%d-%y %H:%M:%S" |
| 140 | memcpy(mTimeStampcxx . . $ PlainLogWidget#mTimeStamp.+8, " ", 2); |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | QStringcxx . . $ QString# PlainLogWidgetcxx . . $ PlainLogWidget#::toPlainTextcxx . . $ PlainLogWidget#toPlainText(4365c3963150523e).() |
| 145 | { |
| 146 | return QTextEditcxx . . $ QString#QString(e1217c004a86c950).::toPlainTextcxx . . $ QTextEdit#toPlainText(6ef7b6c27b00b43d).(); |
| 147 | } |
| 148 | |
| 149 | bool PlainLogWidgetcxx . . $ PlainLogWidget#::isOSLogcxx . . $ PlainLogWidget#isOSLog(c9857a73d68e59ba).() |
| 150 | { |
| 151 | return false; |
| 152 | } |
| 153 | |
| 154 | void PlainLogWidgetcxx . . $ PlainLogWidget#::writeToFilecxx . . $ PlainLogWidget#writeToFile(c5c4b58b43b7b49).(WriteTypecxx . . $ PlainLogWidget#WriteType# type) |
| 155 | { |
| 156 | QTextDocumentcxx . . $ QTextDocument# *oldDocument = QTextEditcxx . . $ QTextEdit#::documentcxx . . $ QTextEdit#document(f21741221844491e).(); |
| 157 | if (mSaveLogcxx . . $ PlainLogWidget#mSaveLog. || type == MenuCommandcxx . . $ PlainLogWidget#MenuCommand.) |
| 158 | { |
| 159 | QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(mLogFileNamecxx . . $ PlainLogWidget#mLogFileName.); |
| 160 | |
| 161 | if (!file.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::Appendcxx . . $ QIODevice#Append. |cxx . . $ `operator|`(e858de6b2553445b). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) |
| 162 | { |
| 163 | hOutDebugcxx . . $ `HercStudio/HerculesStudio.h:49:9`!(0,"Failed to open file " << mLogFileName.toStdString()); |
| 164 | return ; |
| 165 | } |
| 166 | QTextStreamcxx . . $ QTextStream# outcxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&file); |
| 167 | |
| 168 | QTextBlockcxx . . $ QTextBlock# block = oldDocumentcxx . . $ QTextBlock#QTextBlock(ca9d602f58d4ee04).->begincxx . . $ QTextDocument#begin(fcb2c37f271a2a41).(); |
| 169 | |
| 170 | // skip lines that were already written |
| 171 | long linecount = 0; |
| 172 | while(linecount < mLinesWrittencxx . . $ PlainLogWidget#mLinesWritten. && block !=cxx . . $ QTextBlock#`operator!=`(68945a987ded4d28). oldDocument->endcxx . . $ QTextDocument#end(fcb2c37f271a2a41).()) |
| 173 | { |
| 174 | block=cxx . . $ QTextBlock#`operator=`(b837fc91fbe92fa9).block.nextcxx . . $ QTextBlock#next(fcb2c37f271a2a41).(); |
| 175 | linecount++; |
| 176 | } |
| 177 | |
| 178 | // write new lines |
| 179 | while(block !=cxx . . $ QTextBlock#`operator!=`(68945a987ded4d28). oldDocument->endcxx . . $ QTextDocument#end(fcb2c37f271a2a41).()) |
| 180 | { |
| 181 | out <<cxx . . $ QTextStream#`operator<<`(a8e98279dde0dccf). block.textcxx . . $ QTextBlock#text(6ef7b6c27b00b43d).().toUtf8cxx . . $ QString#toUtf8(7c2073558a834e49).().datacxx . . $ QByteArray#data(41208ce6ca65dd58).() <<cxx . . $ QTextStream#`operator<<`(a8e98279dde0dccf). "\n"; |
| 182 | mLinesWrittencxx . . $ PlainLogWidget#mLinesWritten.++; |
| 183 | block=cxx . . $ QTextBlock#`operator=`(b837fc91fbe92fa9).block.nextcxx . . $ QTextBlock#next(fcb2c37f271a2a41).(); |
| 184 | } |
| 185 | file.closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).(); |
| 186 | } |
| 187 | if (type == Overflowcxx . . $ PlainLogWidget#Overflow.) |
| 188 | { |
| 189 | oldDocument->clearcxx . . $ QTextDocument#clear(49f6e7a06ebc5aa8).(); |
| 190 | QTextDocumentcxx . . $ QTextDocument# *newBlock = new QTextDocumentcxx . . $ QTextDocument#(this); |
| 191 | QTextEditcxx . . $ QTextEdit#::setDocumentcxx . . $ QTextEdit#setDocument(68d7deb16251beb9).(newBlock); |
| 192 | mLinesWrittencxx . . $ PlainLogWidget#mLinesWritten. = 0; |
| 193 | getTimeStampcxx . . $ PlainLogWidget#getTimeStamp(b45ddcbc8423892c).(true); |
| 194 | QStringcxx . . $ QString# sepLinecxx . . $ QString#QString(e1217c004a86c950). = "---------------- log was saved at "cxx . . $ QString#QString(85c52e162fed56f9).; |
| 195 | sepLine +=cxx . . $ QString#`operator+=`(d02845eef0c33901). mTimeStampcxx . . $ PlainLogWidget#mTimeStamp.; |
| 196 | sepLine +=cxx . . $ QString#`operator+=`(d02845eef0c33901). "-------------------------"; |
| 197 | QTextEditcxx . . $ QTextEdit#::appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(sepLine); |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | void PlainLogWidgetcxx . . $ PlainLogWidget#::preferencesChangedcxx . . $ PlainLogWidget#preferencesChanged(49f6e7a06ebc5aa8).() |
| 202 | { |
| 203 | mLogFileLinescxx . . $ PlainLogWidget#mLogFileLines. = Preferencescxx . . $ Preferences#::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).().logFileLinescxx . . $ Preferences#logFileLines(455f465bc33b4cdf).(); // might have been updated |
| 204 | bool prevDarkBackground = mDarkBackgroundcxx . . $ PlainLogWidget#mDarkBackground.; |
| 205 | mDarkBackgroundcxx . . $ PlainLogWidget#mDarkBackground. = Preferencescxx . . $ Preferences#::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).().darkBackgroundcxx . . $ Preferences#darkBackground(50ce9a9e25b4a850).(); |
| 206 | if (mDarkBackgroundcxx . . $ PlainLogWidget#mDarkBackground. != prevDarkBackground) |
| 207 | { |
| 208 | QBrushcxx . . $ QBrush# brushcxx . . $ QBrush#QBrush(b50947b0752ea6ac).(QColorcxx . . $ QColor#QColor(748afa4755bc9595).(180,0,0)); |
| 209 | for (QTextBlockcxx . . $ QTextBlock# tb=QTextEditcxx . . $ QTextBlock#QTextBlock(ca9d602f58d4ee04).::documentcxx . . $ QTextEdit#document(f21741221844491e).()->begincxx . . $ QTextDocument#begin(fcb2c37f271a2a41).(); |
| 210 | tb !=cxx . . $ QTextBlock#`operator!=`(68945a987ded4d28). QTextEditcxx . . $ QTextEdit#::documentcxx . . $ QTextEdit#document(f21741221844491e).()->endcxx . . $ QTextDocument#end(fcb2c37f271a2a41).(); |
| 211 | tb =cxx . . $ QTextBlock#`operator=`(b837fc91fbe92fa9). tb.nextcxx . . $ QTextBlock#next(fcb2c37f271a2a41).()) |
| 212 | { |
| 213 | tb.blockFormatcxx . . $ QTextBlock#blockFormat(428a09859bc1ff4e).().setForegroundcxx . . $ QTextFormat#setForeground(ffc9f5d0bda78261).(mGreencxx . . $ QBrush#QBrush(b50947b0752ea6ac).); |
| 214 | |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | void PlainLogWidgetcxx . . $ PlainLogWidget#::setIpledcxx . . $ PlainLogWidget#setIpled(b45ddcbc8423892c).(bool ipled) |
| 220 | { |
| 221 | mIpledcxx . . $ PlainLogWidget#mIpled. = ipled; |
| 222 | } |
| 223 | |
| 224 | void PlainLogWidgetcxx . . $ PlainLogWidget#::clearcxx . . $ PlainLogWidget#clear(49f6e7a06ebc5aa8).() |
| 225 | { |
| 226 | QTextEditcxx . . $ QTextEdit#::clearcxx . . $ QTextEdit#clear(49f6e7a06ebc5aa8).(); |
| 227 | } |
| 228 | |
| 229 | void PlainLogWidgetcxx . . $ PlainLogWidget#::keepSelectioncxx . . $ PlainLogWidget#keepSelection(b45ddcbc8423892c).(bool selected) |
| 230 | { |
| 231 | hOutDebugcxx . . $ `HercStudio/HerculesStudio.h:49:9`!(4, "copyAvailable " << (selected?"y":"f")); |
| 232 | mSelectedTextExistscxx . . $ PlainLogWidget#mSelectedTextExists. = selected; |
| 233 | } |
| 234 | |
| 235 | bool PlainLogWidgetcxx . . $ PlainLogWidget#::textIsSelectedcxx . . $ PlainLogWidget#textIsSelected(c9857a73d68e59ba).() |
| 236 | { |
| 237 | return mSelectedTextExistscxx . . $ PlainLogWidget#mSelectedTextExists.; |
| 238 | } |
| 239 | |
| 240 | QStringcxx . . $ QString# PlainLogWidgetcxx . . $ PlainLogWidget#::copySelectedTextcxx . . $ PlainLogWidget#copySelectedText(4365c3963150523e).() |
| 241 | { |
| 242 | if (mSelectedTextExistscxx . . $ PlainLogWidget#mSelectedTextExists.) |
| 243 | { |
| 244 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! logCopycxx . . $ PlainLogWidget#logCopy(49f6e7a06ebc5aa8).(); |
| 245 | hOutDebugcxx . . $ `HercStudio/HerculesStudio.h:49:9`!(4, "clipboard: '" << QApplication::clipboard()->text().toStdString() << "'"); |
| 246 | } |
| 247 | return QApplicationcxx . . $ QString#QString(e1217c004a86c950).::clipboardcxx . . $ QGuiApplication#clipboard(a5a00f8d44f5ac9e).()->textcxx . . $ QClipboard#text(736a4da42e4ed99d).(); |
| 248 | } |
| 249 | |
| 250 | LogWidgetcxx . . $ LogWidget#::LogWidgetcxx . . $ LogWidget#LogWidget(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# * parent) |
| 251 | : PlainLogWidgetcxx . . $ PlainLogWidget#(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!), cHercIndexcxx . . $ LogWidget#cHercIndex.(0), cOsIndexcxx . . $ LogWidget#cOsIndex.(1) |
| 252 | { |
| 253 | mTabWidgetcxx . . $ LogWidget#mTabWidget. = new QTabWidgetcxx . . $ QTabWidget#QTabWidget(108f35f7aa7f3cf9).(parent); |
| 254 | mLogscxx . . $ LogWidget#mLogs.[cHercIndexcxx . . $ LogWidget#cHercIndex.] = new PlainLogWidgetcxx . . $ PlainLogWidget#(this, "hercules"); |
| 255 | mLogscxx . . $ LogWidget#mLogs.[cOsIndexcxx . . $ LogWidget#cOsIndex.] = new PlainLogWidgetcxx . . $ PlainLogWidget#(this, "os"); |
| 256 | mTabWidgetcxx . . $ LogWidget#mTabWidget.->addTabcxx . . $ QTabWidget#addTab(308397e7339ec173).(mLogscxx . . $ LogWidget#mLogs.[cHercIndexcxx . . $ LogWidget#cHercIndex.], "Hercules"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 257 | mTabWidgetcxx . . $ LogWidget#mTabWidget.->addTabcxx . . $ QTabWidget#addTab(308397e7339ec173).(mLogscxx . . $ LogWidget#mLogs.[cOsIndexcxx . . $ LogWidget#cOsIndex.], "OS"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 258 | |
| 259 | for_each_logcxx . . $ `HercStudio/LogWidget.cpp:43:9`! |
| 260 | { |
| 261 | current_logcxx . . $ `HercStudio/LogWidget.cpp:45:9`!->setReadOnlycxx . . $ QTextEdit#setReadOnly(b45ddcbc8423892c).(true); |
| 262 | current_logcxx . . $ `HercStudio/LogWidget.cpp:45:9`!->setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 263 | } |
| 264 | mIpledcxx . . $ LogWidget#mIpled. = false; |
| 265 | } |
| 266 | |
| 267 | LogWidgetcxx . . $ LogWidget#::~cxx . . $ LogWidget#`~LogWidget`(49f6e7a06ebc5aa8).LogWidgetcxx . . $ LogWidget#() |
| 268 | { |
| 269 | } |
| 270 | |
| 271 | QTabWidgetcxx . . $ QTabWidget# * LogWidgetcxx . . $ LogWidget#::tabWidgetcxx . . $ LogWidget#tabWidget(b0d9db5e8d60deb8).() |
| 272 | { |
| 273 | return mTabWidgetcxx . . $ LogWidget#mTabWidget.; |
| 274 | } |
| 275 | void LogWidgetcxx . . $ LogWidget#::clearcxx . . $ LogWidget#clear(49f6e7a06ebc5aa8).() |
| 276 | { |
| 277 | for_each_logcxx . . $ `HercStudio/LogWidget.cpp:43:9`! |
| 278 | current_logcxx . . $ `HercStudio/LogWidget.cpp:45:9`!->clearcxx . . $ PlainLogWidget#clear(49f6e7a06ebc5aa8).(); |
| 279 | } |
| 280 | |
| 281 | void LogWidgetcxx . . $ LogWidget#::setReadOnlycxx . . $ LogWidget#setReadOnly(b45ddcbc8423892c).(bool ro) |
| 282 | { |
| 283 | for_each_logcxx . . $ `HercStudio/LogWidget.cpp:43:9`! |
| 284 | current_logcxx . . $ `HercStudio/LogWidget.cpp:45:9`!->setReadOnlycxx . . $ QTextEdit#setReadOnly(b45ddcbc8423892c).(ro); |
| 285 | } |
| 286 | |
| 287 | void LogWidgetcxx . . $ LogWidget#::appendcxx . . $ LogWidget#append(45672f3c6961a244).(const QByteArraycxx . . $ QByteArray# & text) |
| 288 | { |
| 289 | QByteArraycxx . . $ QByteArray# s = textcxx . . $ QByteArray#QByteArray(45672f3c6961a244).; |
| 290 | hOutDebugcxx . . $ `HercStudio/HerculesStudio.h:49:9`!(3, s.data()); |
| 291 | if (text.datacxx . . $ QByteArray#data(a9f41ea0e82d88cf).()[0] == '<') |
| 292 | s =cxx . . $ QByteArray#`operator=`(d0b0ff031ded1fc3). text.midcxx . . $ QByteArray#mid(7d967001c4837235).(24); |
| 293 | if (text.startsWithcxx . . $ QByteArray#startsWith(7d4bdb1abc417636).("HHC") || !mIpledcxx . . $ LogWidget#mIpled.) |
| 294 | mLogscxx . . $ LogWidget#mLogs.[cHercIndexcxx . . $ LogWidget#cHercIndex.]->appendcxx . . $ PlainLogWidget#append(45672f3c6961a244).(s); |
| 295 | else |
| 296 | mLogscxx . . $ LogWidget#mLogs.[cOsIndexcxx . . $ LogWidget#cOsIndex.]->appendcxx . . $ PlainLogWidget#append(45672f3c6961a244).(s); |
| 297 | } |
| 298 | |
| 299 | void LogWidgetcxx . . $ LogWidget#::setFontcxx . . $ LogWidget#setFont(d0a4bd0c8524b912).(const QFontcxx . . $ QFont# & font) |
| 300 | { |
| 301 | for_each_logcxx . . $ `HercStudio/LogWidget.cpp:43:9`! |
| 302 | current_logcxx . . $ `HercStudio/LogWidget.cpp:45:9`!->setFontcxx . . $ QWidget#setFont(d0a4bd0c8524b912).(font); |
| 303 | } |
| 304 | |
| 305 | void LogWidgetcxx . . $ LogWidget#::setTextBackgroundColorcxx . . $ LogWidget#setTextBackgroundColor(129a55e114526ad3). (const QColorcxx . . $ QColor# &color) |
| 306 | { |
| 307 | for_each_logcxx . . $ `HercStudio/LogWidget.cpp:43:9`! |
| 308 | current_logcxx . . $ `HercStudio/LogWidget.cpp:45:9`!->setTextBackgroundColorcxx . . $ QTextEdit#setTextBackgroundColor(129a55e114526ad3).(color); |
| 309 | } |
| 310 | |
| 311 | void LogWidgetcxx . . $ LogWidget#::setTextColorcxx . . $ LogWidget#setTextColor(129a55e114526ad3). (const QColorcxx . . $ QColor# &color) |
| 312 | { |
| 313 | for_each_logcxx . . $ `HercStudio/LogWidget.cpp:43:9`! |
| 314 | current_logcxx . . $ `HercStudio/LogWidget.cpp:45:9`!->setTextColorcxx . . $ QTextEdit#setTextColor(129a55e114526ad3).(color); |
| 315 | } |
| 316 | |
| 317 | QStringcxx . . $ QString# LogWidgetcxx . . $ LogWidget#::toPlainTextcxx . . $ LogWidget#toPlainText(4365c3963150523e).() |
| 318 | { |
| 319 | QStringcxx . . $ QString# retcxx . . $ QString#QString(49f6e7a06ebc5aa8).; |
| 320 | for_each_logcxx . . $ `HercStudio/LogWidget.cpp:43:9`! |
| 321 | ret +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). current_logcxx . . $ `HercStudio/LogWidget.cpp:45:9`!->toPlainTextcxx . . $ PlainLogWidget#toPlainText(4365c3963150523e).(); |
| 322 | return retcxx . . $ QString#QString(e1217c004a86c950).; |
| 323 | } |
| 324 | |
| 325 | bool LogWidgetcxx . . $ LogWidget#::emptycxx . . $ LogWidget#empty(c9857a73d68e59ba).() |
| 326 | { |
| 327 | return mLogscxx . . $ LogWidget#mLogs.[cHercIndexcxx . . $ LogWidget#cHercIndex.]->documentcxx . . $ QTextEdit#document(f21741221844491e).()->isEmptycxx . . $ QTextDocument#isEmpty(50ce9a9e25b4a850).() && mLogscxx . . $ LogWidget#mLogs.[cOsIndexcxx . . $ LogWidget#cOsIndex.]->documentcxx . . $ QTextEdit#document(f21741221844491e).()->isEmptycxx . . $ QTextDocument#isEmpty(50ce9a9e25b4a850).(); |
| 328 | } |
| 329 | |
| 330 | bool LogWidgetcxx . . $ LogWidget#::isOSLogcxx . . $ LogWidget#isOSLog(c9857a73d68e59ba).() |
| 331 | { |
| 332 | return (mTabWidgetcxx . . $ LogWidget#mTabWidget.->currentIndexcxx . . $ QTabWidget#currentIndex(455f465bc33b4cdf).() == 1); |
| 333 | } |
| 334 | |
| 335 | void LogWidgetcxx . . $ LogWidget#::writeToFilecxx . . $ LogWidget#writeToFile(c5c4b58b43b7b49).(WriteTypecxx . . $ PlainLogWidget#WriteType# writeType) |
| 336 | { |
| 337 | for_each_logcxx . . $ `HercStudio/LogWidget.cpp:43:9`! |
| 338 | current_logcxx . . $ `HercStudio/LogWidget.cpp:45:9`!->writeToFilecxx . . $ PlainLogWidget#writeToFile(c5c4b58b43b7b49).(writeType); |
| 339 | } |
| 340 | |
| 341 | void LogWidgetcxx . . $ LogWidget#::preferencesChangedcxx . . $ LogWidget#preferencesChanged(49f6e7a06ebc5aa8).() |
| 342 | { |
| 343 | for_each_logcxx . . $ `HercStudio/LogWidget.cpp:43:9`! |
| 344 | current_logcxx . . $ `HercStudio/LogWidget.cpp:45:9`!->preferencesChangedcxx . . $ PlainLogWidget#preferencesChanged(49f6e7a06ebc5aa8).(); |
| 345 | } |
| 346 | |
| 347 | void LogWidgetcxx . . $ LogWidget#::setIpledcxx . . $ LogWidget#setIpled(b45ddcbc8423892c).(bool ipled) |
| 348 | { |
| 349 | mIpledcxx . . $ LogWidget#mIpled. = ipled; |
| 350 | } |
| 351 | |
| 352 | bool LogWidgetcxx . . $ LogWidget#::textIsSelectedcxx . . $ LogWidget#textIsSelected(c9857a73d68e59ba).() |
| 353 | { |
| 354 | return mLogscxx . . $ LogWidget#mLogs.[mTabWidgetcxx . . $ LogWidget#mTabWidget.->currentIndexcxx . . $ QTabWidget#currentIndex(455f465bc33b4cdf).()]->textIsSelectedcxx . . $ PlainLogWidget#textIsSelected(c9857a73d68e59ba).(); |
| 355 | } |
| 356 | |
| 357 | QStringcxx . . $ QString# LogWidgetcxx . . $ LogWidget#::copySelectedTextcxx . . $ LogWidget#copySelectedText(4365c3963150523e).() |
| 358 | { |
| 359 | return mLogscxx . . $ QString#QString(e1217c004a86c950).[mTabWidgetcxx . . $ LogWidget#mTabWidget.->currentIndexcxx . . $ QTabWidget#currentIndex(455f465bc33b4cdf).()]->copySelectedTextcxx . . $ PlainLogWidget#copySelectedText(4365c3963150523e).(); |
| 360 | } |