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