[rkward-cvs] SF.net SVN: rkward: [969] trunk/rkward/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Tue Nov 28 13:55:50 UTC 2006
Revision: 969
http://svn.sourceforge.net/rkward/?rev=969&view=rev
Author: tfry
Date: 2006-11-28 05:55:50 -0800 (Tue, 28 Nov 2006)
Log Message:
-----------
Further watch -> log adjustments
Modified Paths:
--------------
trunk/rkward/rkward/rkward.cpp
trunk/rkward/rkward/windows/rkcommandlog.cpp
trunk/rkward/rkward/windows/rkcommandlog.h
Modified: trunk/rkward/rkward/rkward.cpp
===================================================================
--- trunk/rkward/rkward/rkward.cpp 2006-11-28 13:45:54 UTC (rev 968)
+++ trunk/rkward/rkward/rkward.cpp 2006-11-28 13:55:50 UTC (rev 969)
@@ -183,7 +183,7 @@
RKCommandLog::getLog ()->setName ("Command log"); // TODO: move to RKCommandLog
RKCommandLog::getLog ()->setIcon (SmallIcon ("text_block")); // TODO: move to RKCommandLog
watch_view = addToolWindow (RKCommandLog::getLog (), KDockWidget::DockBottom, getMainDockWidget (), 10);
- connect (RKCommandLog::getLog (), SIGNAL (raiseWatch ()), this, SLOT (raiseWatch ()));
+ connect (RKCommandLog::getLog (), SIGNAL (raiseWindow ()), this, SLOT (raiseWatch ()));
RKGlobals::rcontrol->setCaption (i18n ("Pending Jobs"));
RKGlobals::rcontrol->setName ("rcontrol");
Modified: trunk/rkward/rkward/windows/rkcommandlog.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkcommandlog.cpp 2006-11-28 13:45:54 UTC (rev 968)
+++ trunk/rkward/rkward/windows/rkcommandlog.cpp 2006-11-28 13:55:50 UTC (rev 969)
@@ -2,7 +2,7 @@
rkcommandlog - description
-------------------
begin : Sun Nov 3 2002
- copyright : (C) 2002, 2006 by Thomas Friedrichsmeier
+ copyright : (C) 2002, 2004, 2005 2006 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
@@ -56,17 +56,17 @@
RKCommandLog::RKCommandLog () : KMdiChildView () {
RK_TRACE (APP);
- watch = new QTextEdit (this);
- watch->setTextFormat (PlainText);
- watch->setUndoRedoEnabled (false);
- watch->setReadOnly (true);
+ log_view = new QTextEdit (this);
+ log_view->setTextFormat (PlainText);
+ log_view->setUndoRedoEnabled (false);
+ log_view->setReadOnly (true);
- pLayout = new QHBoxLayout( this, 0, -1, "layout");
- pLayout->addWidget(watch);
+ QHBoxLayout *layout = new QHBoxLayout (this, 0, -1, "layout");
+ layout->addWidget (log_view);
setCaption (i18n ("Command log"));
- clearWatch ();
+ clearLog ();
last_raised_command = 0;
command_input_shown = 0;
@@ -92,21 +92,21 @@
// TODO: make colors/styles configurable
if (command->type () & RCommand::User) {
- watch->setColor (Qt::red);
+ log_view->setColor (Qt::red);
} else if (command->type () & RCommand::Sync) {
- watch->setColor (Qt::gray);
+ log_view->setColor (Qt::gray);
} else if (command->type () & RCommand::Plugin) {
- watch->setColor (Qt::blue);
+ log_view->setColor (Qt::blue);
}
- watch->setItalic (true);
+ log_view->setItalic (true);
- watch->append (command->command () + "\n");
+ log_view->append (command->command () + "\n");
- checkRaiseWatch (command);
+ checkRaiseWindow (command);
linesAdded ();
- watch->setItalic (false);
+ log_view->setItalic (false);
command_input_shown = command->id ();
}
@@ -115,32 +115,32 @@
RK_TRACE (APP);
if (command->type () & RCommand::User) {
- watch->setColor (Qt::red);
+ log_view->setColor (Qt::red);
} else if (command->type () & RCommand::Sync) {
- watch->setColor (Qt::gray);
+ log_view->setColor (Qt::gray);
} else if (command->type () & RCommand::Plugin) {
- watch->setColor (Qt::blue);
+ log_view->setColor (Qt::blue);
}
- watch->setBold (true);
+ log_view->setBold (true);
- watch->insert (output);
+ log_view->insert (output);
- checkRaiseWatch (command);
+ checkRaiseWindow (command);
linesAdded ();
- watch->setBold (false);
- watch->setColor (Qt::black);
+ log_view->setBold (false);
+ log_view->setColor (Qt::black);
}
-void RKCommandLog::checkRaiseWatch (RCommand *command) {
+void RKCommandLog::checkRaiseWindow (RCommand *command) {
// called during output. do not trace
if (command->id () == last_raised_command) return;
if (!RKSettingsModuleWatch::shouldRaiseWindow (command)) return;
if (command->type () & RCommand::Console) return;
last_raised_command = command->id ();
- emit (raiseWatch ());
+ emit (raiseWindow ());
}
void RKCommandLog::newOutput (RCommand *command, ROutput *output_fragment) {
@@ -177,7 +177,7 @@
}
}
- if (RKSettingsModuleWatch::shouldShowOutput (command)) watch->append ("\n");
+ if (RKSettingsModuleWatch::shouldShowOutput (command)) log_view->append ("\n");
}
void RKCommandLog::linesAdded () {
@@ -185,35 +185,35 @@
// limit number of lines shown
if (RKSettingsModuleWatch::maxLogLines ()) {
- uint c = (uint) watch->paragraphs ();
+ uint c = (uint) log_view->paragraphs ();
if (c > RKSettingsModuleWatch::maxLogLines ()) {
- watch->setUpdatesEnabled (false); // major performance boost while removing lines!
- watch->setSelection (0, 0, c - RKSettingsModuleWatch::maxLogLines (), 0, 1);
- watch->removeSelectedText (1);
- watch->setUpdatesEnabled (true);
- watch->update ();
+ log_view->setUpdatesEnabled (false); // major performance boost while removing lines!
+ log_view->setSelection (0, 0, c - RKSettingsModuleWatch::maxLogLines (), 0, 1);
+ log_view->removeSelectedText (1);
+ log_view->setUpdatesEnabled (true);
+ log_view->update ();
}
}
// scroll to bottom
- watch->moveCursor (QTextEdit::MoveEnd, false);
- watch->scrollToBottom ();
+ log_view->moveCursor (QTextEdit::MoveEnd, false);
+ log_view->scrollToBottom ();
}
-void RKCommandLog::configureWatch () {
+void RKCommandLog::configureLog () {
RK_TRACE (APP);
RKSettings::configureSettings (RKSettings::Watch, this);
}
-void RKCommandLog::clearWatch () {
+void RKCommandLog::clearLog () {
RK_TRACE (APP);
- watch->setText (QString::null);
+ log_view->setText (QString::null);
// set a fixed width font
QFont font ("Courier");
- watch->setCurrentFont (font);
- watch->setWordWrap (QTextEdit::NoWrap);
+ log_view->setCurrentFont (font);
+ log_view->setWordWrap (QTextEdit::NoWrap);
}
#include "rkcommandlog.moc"
Modified: trunk/rkward/rkward/windows/rkcommandlog.h
===================================================================
--- trunk/rkward/rkward/windows/rkcommandlog.h 2006-11-28 13:45:54 UTC (rev 968)
+++ trunk/rkward/rkward/windows/rkcommandlog.h 2006-11-28 13:55:50 UTC (rev 969)
@@ -2,7 +2,7 @@
rkcommandlog - description
-------------------
begin : Sun Nov 3 2002
- copyright : (C) 2002, 2006 by Thomas Friedrichsmeier
+ copyright : (C) 2002, 2004, 2005, 2006 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
@@ -38,40 +38,39 @@
class RKCommandLog : public KMdiChildView, public RCommandReceiver {
Q_OBJECT
public:
-/** Adds input to the watch-window (i.e. commands issued) */
+/** Adds input to the log_view-window (i.e. commands issued) */
void addInput (RCommand *command);
-/** Adds output to the watch-window (i.e. replies received) */
+/** Adds output to the log_view-window (i.e. replies received) */
void newOutput (RCommand *command, ROutput *output_fragment);
static void create ();
static void destroy ();
static RKCommandLog *getLog () { return rkcommand_log; };
signals:
-/** the watch emits this, when it should be raised (apparently this can only be done from the main frame) */
- void raiseWatch ();
+/** the log_view emits this, when it should be raised (apparently this can only be done from the main frame) */
+ void raiseWindow ();
protected:
/** Command has finished. If the command has failed, it may be neccessary to print some more information */
void rCommandDone (RCommand *command);
RKCommandLog ();
~RKCommandLog ();
public slots:
-/** configures the watch-window */
- void configureWatch ();
-/** clears the watch-window */
- void clearWatch ();
+/** configures the log_view-window */
+ void configureLog ();
+/** clears the log_view-window */
+ void clearLog ();
private:
void addInputNoCheck (RCommand *command);
void addOutputNoCheck (RCommand *command, const QString &output);
- void checkRaiseWatch (RCommand *command);
+ void checkRaiseWindow (RCommand *command);
/** internal helper function, called whenever a line/lines have been added. Check whether log is longer than maximum setting. Scroll to the bottom */
void linesAdded ();
/** Id of last command the input (i.e. the command itself) was shown for. Used to keep track of whether a command's input should be shown or not */
int command_input_shown;
-/** On a given command, the watch should not be raised more than once */
+/** On a given command, the log_view should not be raised more than once */
int last_raised_command;
- QTextEdit *watch;
- QBoxLayout* pLayout;
+ QTextEdit *log_view;
static RKCommandLog *rkcommand_log;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list