Added new command /clear to clear active window.

master
Tomatix 5 years ago
parent 9f76ab644c
commit b7f99beaed
  1. 1
      ICommand/Commands.h
  2. 6
      ICommand/ICommand.cpp
  3. 1
      IWin/IWin.h
  4. 1
      IWin/IWinChannel.h
  5. 1
      IWin/IWinPrivate.h
  6. 1
      IWin/IWinStatus.h
  7. 2
      Widgets/IIRCView.h

@ -28,6 +28,7 @@ namespace Command::Internal {
constexpr auto* QUERY = "QUERY";
constexpr auto* MUTERESP = "MUTERESP";
constexpr auto* UNMUTERESP = "UNMUTERESP";
constexpr auto* CLEAR = "CLEAR";
}
#endif // ICOMMAND_COMMANDS_H

@ -543,6 +543,12 @@ bool ICommand::tryParseInternal(QString cmdLine)
return true;
}
else if (command == CLEAR) {
auto& mdi = MdiManager::instance();
mdi.currentWindow()->clear();
return true;
}
return false;
}

@ -48,6 +48,7 @@ public:
virtual bool print(PrintType ptype, const QString& text) = 0;
virtual void refreshWindowTitle() = 0;
virtual void clear() = 0;
const QString& getButtonText() const;
void setButtonText(const QString& text);

@ -43,6 +43,7 @@ public:
bool print(const PrintType ptype, const QString& text) override;
void refreshWindowTitle() override;
void clear() override { view->resetView(); }
void resetNicklist();
private:

@ -37,6 +37,7 @@ public:
IWinPrivate(IWinStatus* statusParent, const QString& targetName);
bool print(const PrintType ptype, const QString& text) override;
void refreshWindowTitle() override;
void clear() override { view->resetView(); }
private:
void inputEnter();

@ -41,6 +41,7 @@ public:
bool print(const PrintType ptype, const QString& text) override;
void refreshWindowTitle() override;
void clear() override { view->resetView(); }
void printTo(const QString& target, const PrintType ptype, const QString& text);
void printToTypes(const IWin::Type toType, const PrintType ptype, const QString& text);
void printToActive(const PrintType ptype, const QString& text); // TODO test

@ -85,6 +85,7 @@ class IIRCView : public QTextBrowser
public:
IIRCView();
void print(const PrintType ptype, const QString& text);
void resetView();
static QString stripTags(const QString& text);
static QString formatType(PrintType ptype, const QString& text);
static QString typeToString(PrintType ptype, const QString& defaultValue = "");
@ -98,7 +99,6 @@ private:
void mouseReleaseEvent(QMouseEvent* evt) override;
int reduceMargin() const;
void newConfiguration();
void resetView();
static void formatSpaces(QString& text);
static void ctrlFormat(QString& text);
static void linkFormat(QString& text);

Loading…
Cancel
Save