-rw-r--r-- | noncore/net/opieirc/ircsettings.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/opieirc/ircsettings.cpp b/noncore/net/opieirc/ircsettings.cpp index 7a1dd6c..86e0f11 100644 --- a/noncore/net/opieirc/ircsettings.cpp +++ b/noncore/net/opieirc/ircsettings.cpp | |||
@@ -1,144 +1,144 @@ | |||
1 | 1 | ||
2 | #include "ircsettings.h" | 2 | #include "ircsettings.h" |
3 | #include "irctab.h" | 3 | #include "irctab.h" |
4 | #include "ircmisc.h" | 4 | #include "ircmisc.h" |
5 | 5 | ||
6 | /* OPIE */ | 6 | /* OPIE */ |
7 | #include <opie2/ocolorbutton.h> | 7 | #include <opie2/ocolorbutton.h> |
8 | #include <opie2/otabwidget.h> | 8 | #include <opie2/otabwidget.h> |
9 | #include <opie2/okeyconfigwidget.h> | 9 | #include <opie2/okeyconfigwidget.h> |
10 | #include <qpe/qpeapplication.h> | 10 | #include <qpe/qpeapplication.h> |
11 | 11 | ||
12 | /* QT */ | 12 | /* QT */ |
13 | #include <qvalidator.h> | 13 | #include <qvalidator.h> |
14 | #include <qwhatsthis.h> | 14 | #include <qwhatsthis.h> |
15 | #include <qcheckbox.h> | 15 | #include <qcheckbox.h> |
16 | 16 | ||
17 | using namespace Opie; | 17 | using namespace Opie; |
18 | using namespace Opie::Ui; | 18 | using namespace Opie::Ui; |
19 | IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) | 19 | IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) |
20 | { | 20 | { |
21 | setCaption(tr("Settings") ); | 21 | setCaption(tr("Settings") ); |
22 | m_config = new Config("OpieIRC"); | 22 | m_config = new Config("OpieIRC"); |
23 | m_config->setGroup("OpieIRC"); | 23 | m_config->setGroup("OpieIRC"); |
24 | QHBoxLayout *l = new QHBoxLayout(this, 2, 2); | 24 | QHBoxLayout *l = new QHBoxLayout(this, 2, 2); |
25 | OTabWidget *tw = new OTabWidget(this); | 25 | OTabWidget *tw = new OTabWidget(this); |
26 | l->addWidget(tw); | 26 | l->addWidget(tw); |
27 | /* General Configuration */ | 27 | /* General Configuration */ |
28 | QWidget *genwidget = new QWidget(tw); | 28 | QWidget *genwidget = new QWidget(tw); |
29 | QGridLayout *layout = new QGridLayout(genwidget, 1, 4, 5, 0); | 29 | QGridLayout *layout = new QGridLayout(genwidget, 1, 4, 5, 0); |
30 | QLabel *label = new QLabel(tr("Lines displayed :"), genwidget); | 30 | QLabel *label = new QLabel(tr("Lines displayed :"), genwidget); |
31 | layout->addWidget(label, 0, 0); | 31 | layout->addWidget(label, 0, 0); |
32 | m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget); | 32 | m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget); |
33 | QWhatsThis::add(m_lines, tr("Amount of lines to be displayed in chats before old lines get deleted - this is necessary to restrain memory consumption. Set to 0 if you don't need this")); | 33 | QWhatsThis::add(m_lines, tr("Amount of lines to be displayed in chats before old lines get deleted - this is necessary to restrain memory consumption. Set to 0 if you don't need this")); |
34 | QIntValidator *validator = new QIntValidator(this); | 34 | QIntValidator *validator = new QIntValidator(this); |
35 | validator->setTop(10000); | 35 | validator->setTop(10000); |
36 | validator->setBottom(0); | 36 | validator->setBottom(0); |
37 | m_lines->setValidator(validator); | 37 | m_lines->setValidator(validator); |
38 | layout->addWidget(m_lines, 0, 1); | 38 | layout->addWidget(m_lines, 0, 1); |
39 | 39 | ||
40 | /* | 40 | /* |
41 | * include timestamp | 41 | * include timestamp |
42 | */ | 42 | */ |
43 | m_displayTime = new QCheckBox( tr("Display time in chat log"), genwidget ); | 43 | m_displayTime = new QCheckBox( tr("Display time in chat log"), genwidget ); |
44 | m_displayTime->setChecked( m_config->readBoolEntry("DisplayTime", false) ); | 44 | m_displayTime->setChecked( m_config->readBoolEntry("DisplayTime", false) ); |
45 | layout->addMultiCellWidget(m_displayTime, 1, 1, 0, 4 ); | 45 | layout->addMultiCellWidget(m_displayTime, 1, 1, 0, 4 ); |
46 | 46 | ||
47 | // add a spacer | 47 | // add a spacer |
48 | layout->addItem( new QSpacerItem(1,1, QSizePolicy::Minimum, | 48 | layout->addItem( new QSpacerItem(1,1, QSizePolicy::Minimum, |
49 | QSizePolicy::MinimumExpanding), | 49 | QSizePolicy::MinimumExpanding), |
50 | 2, 0 ); | 50 | 2, 0 ); |
51 | 51 | ||
52 | tw->addTab(genwidget, "opieirc/settings", tr("General")); | 52 | tw->addTab(genwidget, "opieirc/settings", tr("General")); |
53 | 53 | ||
54 | /* Color configuration */ | 54 | /* Color configuration */ |
55 | QScrollView *view = new QScrollView(this); | 55 | QScrollView *view = new QScrollView(this); |
56 | view->setResizePolicy(QScrollView::AutoOneFit); | 56 | view->setResizePolicy(QScrollView::AutoOneFit); |
57 | view->setFrameStyle( QFrame::NoFrame ); | 57 | view->setFrameStyle( QFrame::NoFrame ); |
58 | QWidget *widget = new QWidget(view->viewport()); | 58 | QWidget *widget = new QWidget(view->viewport()); |
59 | view->addChild(widget); | 59 | view->addChild(widget); |
60 | layout = new QGridLayout(widget, 7, 2, 5, 0); | 60 | layout = new QGridLayout(widget, 7, 2, 5, 0); |
61 | label = new QLabel(tr("Background color :"), widget); | 61 | label = new QLabel(tr("Background color :"), widget); |
62 | layout->addWidget(label, 0, 0); | 62 | layout->addWidget(label, 0, 0); |
63 | m_background = new OColorButton(widget, m_config->readEntry("BackgroundColor", "#FFFFFF")); | 63 | m_background = new OColorButton(widget, m_config->readEntry("BackgroundColor", "#FFFFFF")); |
64 | QWhatsThis::add(m_background, tr("Background color to be used in chats")); | 64 | QWhatsThis::add(m_background, tr("Background color to be used in chats")); |
65 | layout->addWidget(m_background, 0, 1); | 65 | layout->addWidget(m_background, 0, 1); |
66 | label = new QLabel(tr("Normal text color :"), widget); | 66 | label = new QLabel(tr("Normal text color :"), widget); |
67 | layout->addWidget(label, 1, 0); | 67 | layout->addWidget(label, 1, 0); |
68 | m_text = new OColorButton(widget, m_config->readEntry("TextColor", "#000000")); | 68 | m_text = new OColorButton(widget, m_config->readEntry("TextColor", "#000000")); |
69 | QWhatsThis::add(m_text, tr("Text color to be used in chats")); | 69 | QWhatsThis::add(m_text, tr("Text color to be used in chats")); |
70 | layout->addWidget(m_text, 1, 1); | 70 | layout->addWidget(m_text, 1, 1); |
71 | label = new QLabel(tr("Error color :"), widget); | 71 | label = new QLabel(tr("Error color :"), widget); |
72 | layout->addWidget(label, 2, 0); | 72 | layout->addWidget(label, 2, 0); |
73 | m_error = new OColorButton(widget, m_config->readEntry("ErrorColor", "#FF0000")); | 73 | m_error = new OColorButton(widget, m_config->readEntry("ErrorColor", "#FF0000")); |
74 | QWhatsThis::add(m_error, tr("Text color to be used to display errors")); | 74 | QWhatsThis::add(m_error, tr("Text color to be used to display errors")); |
75 | layout->addWidget(m_error, 2, 1); | 75 | layout->addWidget(m_error, 2, 1); |
76 | label = new QLabel(tr("Text written by yourself :"), widget); | 76 | label = new QLabel(tr("Text written by yourself :"), widget); |
77 | layout->addWidget(label, 3, 0); | 77 | layout->addWidget(label, 3, 0); |
78 | m_self = new OColorButton(widget, m_config->readEntry("SelfColor", "#CC0000")); | 78 | m_self = new OColorButton(widget, m_config->readEntry("SelfColor", "#CC0000")); |
79 | QWhatsThis::add(m_self, tr("Text color to be used to identify text written by yourself")); | 79 | QWhatsThis::add(m_self, tr("Text color to be used to identify text written by yourself")); |
80 | layout->addWidget(m_self, 3, 1); | 80 | layout->addWidget(m_self, 3, 1); |
81 | label = new QLabel(tr("Text written by others :"), widget); | 81 | label = new QLabel(tr("Text written by others :"), widget); |
82 | layout->addWidget(label, 4, 0); | 82 | layout->addWidget(label, 4, 0); |
83 | m_other = new OColorButton(widget, m_config->readEntry("OtherColor", "#0000BB")); | 83 | m_other = new OColorButton(widget, m_config->readEntry("OtherColor", "#0000BB")); |
84 | QWhatsThis::add(m_other, tr("Text color to be used to identify text written by others")); | 84 | QWhatsThis::add(m_other, tr("Text color to be used to identify text written by others")); |
85 | layout->addWidget(m_other, 4, 1); | 85 | layout->addWidget(m_other, 4, 1); |
86 | label = new QLabel(tr("Text written by the server :"), widget); | 86 | label = new QLabel(tr("Text written by the server :"), widget); |
87 | layout->addWidget(label, 5, 0); | 87 | layout->addWidget(label, 5, 0); |
88 | m_server = new OColorButton(widget, m_config->readEntry("ServerColor", "#0000FF")); | 88 | m_server = new OColorButton(widget, m_config->readEntry("ServerColor", "#0000FF")); |
89 | QWhatsThis::add(m_server, tr("Text color to be used to identify text written by the server")); | 89 | QWhatsThis::add(m_server, tr("Text color to be used to identify text written by the server")); |
90 | layout->addWidget(m_server, 5, 1); | 90 | layout->addWidget(m_server, 5, 1); |
91 | label = new QLabel(tr("Notifications :"), widget); | 91 | label = new QLabel(tr("Notifications :"), widget); |
92 | layout->addWidget(label, 6, 0); | 92 | layout->addWidget(label, 6, 0); |
93 | m_notification = new OColorButton(widget, m_config->readEntry("NotificationColor", "#AAE300")); | 93 | m_notification = new OColorButton(widget, m_config->readEntry("NotificationColor", "#006400")); |
94 | QWhatsThis::add(m_notification, tr("Text color to be used to display notifications")); | 94 | QWhatsThis::add(m_notification, tr("Text color to be used to display notifications")); |
95 | layout->addWidget(m_notification, 6, 1); | 95 | layout->addWidget(m_notification, 6, 1); |
96 | tw->addTab(view, "opieirc/colors", tr("Colors")); | 96 | tw->addTab(view, "opieirc/colors", tr("Colors")); |
97 | 97 | ||
98 | 98 | ||
99 | /* | 99 | /* |
100 | * IRC EditLine KeyConfiguration | 100 | * IRC EditLine KeyConfiguration |
101 | */ | 101 | */ |
102 | m_keyConf = new Opie::Ui::OKeyConfigWidget(tw, "KEyConfig GUI" ); | 102 | m_keyConf = new Opie::Ui::OKeyConfigWidget(tw, "KEyConfig GUI" ); |
103 | m_keyConf->setChangeMode( OKeyConfigWidget::Queue ); | 103 | m_keyConf->setChangeMode( OKeyConfigWidget::Queue ); |
104 | m_keyConf->insert( tr("Keyboard Shortcuts"), | 104 | m_keyConf->insert( tr("Keyboard Shortcuts"), |
105 | IRCHistoryLineEdit::keyConfigInstance() ); | 105 | IRCHistoryLineEdit::keyConfigInstance() ); |
106 | m_keyConf->load(); | 106 | m_keyConf->load(); |
107 | tw->addTab(m_keyConf, "SettingsIcon", tr("Keyboard Shortcuts") ); | 107 | tw->addTab(m_keyConf, "SettingsIcon", tr("Keyboard Shortcuts") ); |
108 | 108 | ||
109 | tw->setCurrentTab( genwidget ); | 109 | tw->setCurrentTab( genwidget ); |
110 | QPEApplication::showDialog( this ); | 110 | QPEApplication::showDialog( this ); |
111 | } | 111 | } |
112 | 112 | ||
113 | void IRCSettings::accept() | 113 | void IRCSettings::accept() |
114 | { | 114 | { |
115 | IRCTab::m_backgroundColor = m_background->color().name(); | 115 | IRCTab::m_backgroundColor = m_background->color().name(); |
116 | IRCTab::m_textColor = m_text->color().name(); | 116 | IRCTab::m_textColor = m_text->color().name(); |
117 | IRCTab::m_errorColor = m_error->color().name(); | 117 | IRCTab::m_errorColor = m_error->color().name(); |
118 | IRCTab::m_selfColor = m_self->color().name(); | 118 | IRCTab::m_selfColor = m_self->color().name(); |
119 | IRCTab::m_otherColor = m_other->color().name(); | 119 | IRCTab::m_otherColor = m_other->color().name(); |
120 | IRCTab::m_serverColor = m_server->color().name(); | 120 | IRCTab::m_serverColor = m_server->color().name(); |
121 | IRCTab::m_notificationColor = m_notification->color().name(); | 121 | IRCTab::m_notificationColor = m_notification->color().name(); |
122 | IRCTab::m_maxLines = m_lines->text().toInt(); | 122 | IRCTab::m_maxLines = m_lines->text().toInt(); |
123 | m_keyConf->save(); | 123 | m_keyConf->save(); |
124 | 124 | ||
125 | 125 | ||
126 | m_config->writeEntry("BackgroundColor", IRCTab::m_backgroundColor); | 126 | m_config->writeEntry("BackgroundColor", IRCTab::m_backgroundColor); |
127 | m_config->writeEntry("TextColor", IRCTab::m_textColor); | 127 | m_config->writeEntry("TextColor", IRCTab::m_textColor); |
128 | m_config->writeEntry("ErrorColor", IRCTab::m_errorColor); | 128 | m_config->writeEntry("ErrorColor", IRCTab::m_errorColor); |
129 | m_config->writeEntry("SelfColor", IRCTab::m_selfColor); | 129 | m_config->writeEntry("SelfColor", IRCTab::m_selfColor); |
130 | m_config->writeEntry("OtherColor", IRCTab::m_otherColor); | 130 | m_config->writeEntry("OtherColor", IRCTab::m_otherColor); |
131 | m_config->writeEntry("ServerColor", IRCTab::m_serverColor); | 131 | m_config->writeEntry("ServerColor", IRCTab::m_serverColor); |
132 | m_config->writeEntry("NotificationColor", IRCTab::m_notificationColor); | 132 | m_config->writeEntry("NotificationColor", IRCTab::m_notificationColor); |
133 | m_config->writeEntry("Lines", m_lines->text()); | 133 | m_config->writeEntry("Lines", m_lines->text()); |
134 | m_config->writeEntry("DisplayTime", m_displayTime->isChecked() ); | 134 | m_config->writeEntry("DisplayTime", m_displayTime->isChecked() ); |
135 | IRCTab::setUseTimeStamps(m_displayTime->isChecked()); | 135 | IRCTab::setUseTimeStamps(m_displayTime->isChecked()); |
136 | IRCHistoryLineEdit::keyConfigInstance()->save(); | 136 | IRCHistoryLineEdit::keyConfigInstance()->save(); |
137 | 137 | ||
138 | QDialog::accept(); | 138 | QDialog::accept(); |
139 | } | 139 | } |
140 | 140 | ||
141 | IRCSettings::~IRCSettings() | 141 | IRCSettings::~IRCSettings() |
142 | { | 142 | { |
143 | delete m_config; | 143 | delete m_config; |
144 | } | 144 | } |