[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.158,
From:       kde () office ! kde ! org
Date:       2004-05-23 23:30:32
Message-ID: 40B13418.mailOPT1GBKJM () office ! kde ! org
[Download RAW message or body]

Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv32001/client

Modified Files:
      Tag: KDE_3_2_BRANCH
	atlantik.cpp atlantik.h 
Log Message:
backport: chat view can be cleared (#69044)

Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.158
retrieving revision 1.158.2.1
diff -u -d -r1.158 -r1.158.2.1
--- atlantik.cpp	8 Dec 2003 17:10:19 -0000	1.158
+++ atlantik.cpp	23 May 2004 23:30:30 -0000	1.158.2.1
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2003 Rob Kaper <cap@capsi.com>
+// Copyright (c) 2002-2004 Rob Kaper <cap@capsi.com>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
@@ -20,8 +20,10 @@
 #include <qdatetime.h>
 #include <qlineedit.h>
 #include <qscrollbar.h>
+#include <qpopupmenu.h>
 
 #include <kapplication.h>
+#include <kaction.h>
 #include <kcmdlineargs.h>
 #include <kconfig.h>
 #include <klocale.h>
@@ -47,6 +49,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
@@ -114,7 +142,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.62
retrieving revision 1.62.4.1
diff -u -d -r1.62 -r1.62.4.1
--- atlantik.h	5 Aug 2003 03:03:35 -0000	1.62
+++ atlantik.h	23 May 2004 23:30:30 -0000	1.62.4.1
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2003 Rob Kaper <cap@capsi.com>
+// Copyright (c) 2002-2004 Rob Kaper <cap@capsi.com>
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
@@ -24,7 +24,6 @@
 #include <qptrlist.h>
 
 #include <kmainwindow.h>
-#include <kaction.h>
 
 #include "configdlg.h"
 #include "portfolioview.h"
@@ -65,6 +64,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