Diffstat (limited to 'noncore/net/opieirc/irctab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/irctab.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/noncore/net/opieirc/irctab.cpp b/noncore/net/opieirc/irctab.cpp index 2b3ecd4..fbbf303 100644 --- a/noncore/net/opieirc/irctab.cpp +++ b/noncore/net/opieirc/irctab.cpp | |||
@@ -1,44 +1,60 @@ | |||
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 | #include <qpe/resource.h> | 5 | #include <qpe/resource.h> |
6 | 6 | ||
7 | 7 | ||
8 | #include <qpushbutton.h> | 8 | #include <qpushbutton.h> |
9 | #include <qwhatsthis.h> | 9 | #include <qwhatsthis.h> |
10 | 10 | ||
11 | 11 | ||
12 | QString IRCTab::m_errorColor; | 12 | QString IRCTab::m_errorColor; |
13 | QString IRCTab::m_serverColor; | 13 | QString IRCTab::m_serverColor; |
14 | QString IRCTab::m_textColor; | 14 | QString IRCTab::m_textColor; |
15 | QString IRCTab::m_backgroundColor; | 15 | QString IRCTab::m_backgroundColor; |
16 | QString IRCTab::m_selfColor; | 16 | QString IRCTab::m_selfColor; |
17 | QString IRCTab::m_otherColor; | 17 | QString IRCTab::m_otherColor; |
18 | QString IRCTab::m_notificationColor; | 18 | QString IRCTab::m_notificationColor; |
19 | int IRCTab::m_maxLines; | 19 | int IRCTab::m_maxLines; |
20 | 20 | ||
21 | |||
22 | static bool g_useTime = false; | ||
23 | |||
24 | void IRCTab::setUseTimeStamps( bool b ) { | ||
25 | g_useTime = b; | ||
26 | } | ||
27 | |||
28 | // ## FIXME use TimeString later for AM/PM Setting | ||
29 | QString IRCTab::appendTimestamp( const QString& text ) { | ||
30 | return g_useTime ? | ||
31 | "[" +QTime::currentTime().toString()+"]" + text + "\n" : | ||
32 | text + "\n"; | ||
33 | |||
34 | } | ||
35 | |||
36 | |||
21 | IRCTab::IRCTab(QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f) { | 37 | IRCTab::IRCTab(QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f) { |
22 | m_layout = new QVBoxLayout(this); | 38 | m_layout = new QVBoxLayout(this); |
23 | QHBoxLayout *descLayout = new QHBoxLayout(m_layout); | 39 | QHBoxLayout *descLayout = new QHBoxLayout(m_layout); |
24 | descLayout->setMargin(5); | 40 | descLayout->setMargin(5); |
25 | m_description = new QLabel(tr("Missing description"), this); | 41 | m_description = new QLabel(tr("Missing description"), this); |
26 | QWhatsThis::add(m_description, tr("Description of the tab's content")); | 42 | QWhatsThis::add(m_description, tr("Description of the tab's content")); |
27 | descLayout->addWidget(m_description); | 43 | descLayout->addWidget(m_description); |
28 | descLayout->setStretchFactor(m_description, 5); | 44 | descLayout->setStretchFactor(m_description, 5); |
29 | QPushButton *close = new QPushButton(this); | 45 | QPushButton *close = new QPushButton(this); |
30 | QWhatsThis::add(close, tr("Close this tab")); | 46 | QWhatsThis::add(close, tr("Close this tab")); |
31 | close->setPixmap(Resource::loadPixmap("close")); | 47 | close->setPixmap(Resource::loadPixmap("close")); |
32 | connect(close, SIGNAL(clicked()), this, SLOT(remove())); | 48 | connect(close, SIGNAL(clicked()), this, SLOT(remove())); |
33 | descLayout->addWidget(close); | 49 | descLayout->addWidget(close); |
34 | descLayout->setStretchFactor(m_description, 1); | 50 | descLayout->setStretchFactor(m_description, 1); |
35 | } | 51 | } |
36 | 52 | ||
37 | 53 | ||
38 | void IRCTab::setID(int id) { | 54 | void IRCTab::setID(int id) { |
39 | m_id = id; | 55 | m_id = id; |
40 | } | 56 | } |
41 | 57 | ||
42 | int IRCTab::id() { | 58 | int IRCTab::id() { |
43 | return m_id; | 59 | return m_id; |
44 | } | 60 | } |