summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/irctab.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/noncore/net/opieirc/irctab.cpp b/noncore/net/opieirc/irctab.cpp
index fbbf303..aee33c4 100644
--- a/noncore/net/opieirc/irctab.cpp
+++ b/noncore/net/opieirc/irctab.cpp
@@ -1,66 +1,70 @@
1#include "irctab.h" 1#include "irctab.h"
2#include "mainwindow.h" 2#include "mainwindow.h"
3 3
4#include <opie2/okeyconfigmanager.h> 4#include <opie2/okeyconfigmanager.h>
5
6#include <qpe/applnk.h>
5#include <qpe/resource.h> 7#include <qpe/resource.h>
6 8
7 9
8#include <qpushbutton.h> 10#include <qpushbutton.h>
9#include <qwhatsthis.h> 11#include <qwhatsthis.h>
10 12
11 13
12QString IRCTab::m_errorColor; 14QString IRCTab::m_errorColor;
13QString IRCTab::m_serverColor; 15QString IRCTab::m_serverColor;
14QString IRCTab::m_textColor; 16QString IRCTab::m_textColor;
15QString IRCTab::m_backgroundColor; 17QString IRCTab::m_backgroundColor;
16QString IRCTab::m_selfColor; 18QString IRCTab::m_selfColor;
17QString IRCTab::m_otherColor; 19QString IRCTab::m_otherColor;
18QString IRCTab::m_notificationColor; 20QString IRCTab::m_notificationColor;
19int IRCTab::m_maxLines; 21int IRCTab::m_maxLines;
20 22
21 23
22static bool g_useTime = false; 24static bool g_useTime = false;
23 25
24void IRCTab::setUseTimeStamps( bool b ) { 26void IRCTab::setUseTimeStamps( bool b ) {
25 g_useTime = b; 27 g_useTime = b;
26} 28}
27 29
28// ## FIXME use TimeString later for AM/PM Setting 30// ## FIXME use TimeString later for AM/PM Setting
29QString IRCTab::appendTimestamp( const QString& text ) { 31QString IRCTab::appendTimestamp( const QString& text ) {
30 return g_useTime ? 32 return g_useTime ?
31 "[" +QTime::currentTime().toString()+"]" + text + "\n" : 33 "[" +QTime::currentTime().toString()+"]" + text + "\n" :
32 text + "\n"; 34 text + "\n";
33 35
34} 36}
35 37
36 38
37IRCTab::IRCTab(QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f) { 39IRCTab::IRCTab(QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f) {
38 m_layout = new QVBoxLayout(this); 40 m_layout = new QVBoxLayout(this);
39 QHBoxLayout *descLayout = new QHBoxLayout(m_layout); 41 QHBoxLayout *descLayout = new QHBoxLayout(m_layout);
40 descLayout->setMargin(5); 42 descLayout->setMargin(5);
41 m_description = new QLabel(tr("Missing description"), this); 43 m_description = new QLabel(tr("Missing description"), this);
42 QWhatsThis::add(m_description, tr("Description of the tab's content")); 44 QWhatsThis::add(m_description, tr("Description of the tab's content"));
43 descLayout->addWidget(m_description); 45 descLayout->addWidget(m_description);
44 descLayout->setStretchFactor(m_description, 5); 46 descLayout->setStretchFactor(m_description, 5);
45 QPushButton *close = new QPushButton(this); 47 QPixmap pic;
48 pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
49 QPushButton *close = new QPushButton(pic, QString::null, this);
50 close->setMaximumWidth( close->height() );
46 QWhatsThis::add(close, tr("Close this tab")); 51 QWhatsThis::add(close, tr("Close this tab"));
47 close->setPixmap(Resource::loadPixmap("close"));
48 connect(close, SIGNAL(clicked()), this, SLOT(remove())); 52 connect(close, SIGNAL(clicked()), this, SLOT(remove()));
49 descLayout->addWidget(close); 53 descLayout->addWidget(close);
50 descLayout->setStretchFactor(m_description, 1); 54 descLayout->setStretchFactor(m_description, 1);
51} 55}
52 56
53 57
54void IRCTab::setID(int id) { 58void IRCTab::setID(int id) {
55 m_id = id; 59 m_id = id;
56} 60}
57 61
58int IRCTab::id() { 62int IRCTab::id() {
59 return m_id; 63 return m_id;
60} 64}
61 65
62void IRCTab::showEvent( QShowEvent *ev ) { 66void IRCTab::showEvent( QShowEvent *ev ) {
63 topLevelWidget()->setCaption( MainWindow::appCaption() + " " + title() ); 67 topLevelWidget()->setCaption( MainWindow::appCaption() + " " + title() );
64 QWidget::showEvent( ev ); 68 QWidget::showEvent( ev );
65 emit editFocus(); 69 emit editFocus();
66} 70}