[prev in list] [next in list] [prev in thread] [next in thread]
List: atlantik-devel
Subject: [atlantik-cvs] CVS: kdegames/atlantik/client atlantik.cpp, 1.161,
From: kde () office ! kde ! org
Date: 2004-05-23 23:29:59
Message-ID: 40B133F7.mailOO01YQY76 () office ! kde ! org
[Download RAW message or body]
Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv31936/client
Modified Files:
atlantik.cpp atlantik.h
Log Message:
bugfix: chat view can be cleared (#69044)
Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -d -r1.161 -r1.162
--- atlantik.cpp 10 Feb 2004 19:46:34 -0000 1.161
+++ atlantik.cpp 23 May 2004 23:29:53 -0000 1.162
@@ -20,8 +20,10 @@
#include <qdatetime.h>
#include <qlineedit.h>
#include <qscrollbar.h>
+#include <qpopupmenu.h>
#include <kaboutapplication.h>
+#include <kaction.h>
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <kconfig.h>
@@ -53,6 +55,32 @@
#include "selectgame_widget.h"
#include "selectconfiguration_widget.h"
+LogTextEdit::LogTextEdit( QWidget *parent, const char *name ) : QTextEdit( parent, name )
+{
+ m_clear = KStdAction::clear( this, SLOT( clear() ), 0 );
+ m_selectAll = KStdAction::selectAll( this, SLOT( selectAll() ), 0 );
+ m_copy = KStdAction::copy( this, SLOT( copy() ), 0 );
+}
+
+LogTextEdit::~LogTextEdit()
+{
+ delete m_clear;
+ delete m_selectAll;
+ delete m_copy;
+}
+
+QPopupMenu *LogTextEdit::createPopupMenu( const QPoint & )
+{
+ QPopupMenu *rmbMenu = new QPopupMenu( this );
+ m_clear->plug( rmbMenu );
+ rmbMenu->insertSeparator();
+ m_copy->setEnabled( hasSelectedText() );
+ m_copy->plug( rmbMenu );
+ m_selectAll->plug( rmbMenu );
+
+ return rmbMenu;
+}
+
Atlantik::Atlantik () : KMainWindow ()
{
// Read application configuration
@@ -128,7 +156,7 @@
// m_portfolioLabel->show();
// Text view for chat and status messages from server.
- m_serverMsgs = new QTextEdit(m_mainWidget, "serverMsgs");
+ m_serverMsgs = new LogTextEdit(m_mainWidget, "serverMsgs");
m_serverMsgs->setTextFormat(QTextEdit::PlainText);
m_serverMsgs->setReadOnly(true);
m_serverMsgs->setHScrollBarMode(QScrollView::AlwaysOff);
Index: atlantik.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.h,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- atlantik.h 10 Feb 2004 19:46:34 -0000 1.65
+++ atlantik.h 23 May 2004 23:29:53 -0000 1.66
@@ -24,7 +24,6 @@
#include <qptrlist.h>
#include <kmainwindow.h>
-#include <kaction.h>
#include "configdlg.h"
#include "portfolioview.h"
@@ -67,6 +66,20 @@
class Estate;
class Trade;
+class LogTextEdit : public QTextEdit
+{
+Q_OBJECT
+
+public:
+ LogTextEdit( QWidget *parent = 0, const char *name = 0 );
+ virtual ~LogTextEdit();
+
+ QPopupMenu *LogTextEdit::createPopupMenu( const QPoint & pos );
+
+private:
+ KAction *m_clear, *m_selectAll, *m_copy;
+};
+
/**
* Main Atlantik window.
* Manages gameboard, portfolios and pretty much everything else.
_______________________________________________
atlantik-cvs mailing list
atlantik-cvs@kde.org
https://mail.kde.org/mailman/listinfo/atlantik-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic