/***************************************************************************
- * Copyright (C) 2005-07 by The Quassel IRC Development Team *
+ * Copyright (C) 2005-07 by the Quassel IRC Team *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
MainWidget::MainWidget(QWidget *parent) : QWidget(parent) {
ui.setupUi(this);
-
-// ui.bufferLeft->setIcon(QIcon(":icon/left"));
-// ui.bufferRight->setIcon(QIcon(":icon/right"));
- //ui.bufferLeft->setIconSize(QSize(10, 10));
- //ui.bufferRight->setIconSize(QSize(10, 10));
- //ui.bufferLeft->setMaximumSize(QSize(10,10));
- //ui.bufferRight->setMaximumSize(QSize(10,10));
+ connect(ui.inputLine, SIGNAL(returnPressed()), this, SLOT(enterPressed()));
+ currentBuffer = 0;
}
MainWidget::~MainWidget() {
//connect(buf, SIGNAL(ownNickSet(QString)), this, SLOT(setOwnNick(QString)));
ui.stack->addWidget(chatWidget);
chatWidgets.insert(buf, chatWidget);
- ui.stack->addWidget(chatWidget);
+ chatWidget->setFocusProxy(ui.inputLine);
} else chatWidget = chatWidgets[buf];
ui.stack->setCurrentWidget(chatWidget);
+ ui.inputLine->setFocus();
+ currentBuffer = buf;
+}
+
+void MainWidget::enterPressed() {
+ QStringList lines = ui.inputLine->text().split('\n', QString::SkipEmptyParts);
+ foreach(QString msg, lines) {
+ if(msg.isEmpty()) continue;
+ if(currentBuffer) currentBuffer->processUserInput(msg);
+ }
+ ui.inputLine->clear();
}
<rect>
<x>0</x>
<y>0</y>
- <width>291</width>
- <height>358</height>
+ <width>240</width>
+ <height>320</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<layout class="QVBoxLayout" >
- <property name="margin" >
+ <property name="spacing" >
<number>0</number>
</property>
- <property name="spacing" >
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="TopicBar" name="topicBar" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>3</hsizetype>
- <vsizetype>5</vsizetype>
+ <sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="currentIndex" >
<number>0</number>
</property>
- <widget class="QWidget" name="page" />
+ <widget class="QWidget" name="page" >
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Trebuchet MS'; font-size:10pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:29pt; color:#7fff00;">Quassel IRC</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:29pt; color:#7fff00;"><span style=" font-size:10pt;">mobile edition</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:29pt; color:#483d8b;"><span style=" font-size:6pt; color:#fff8dc;">Chat anywhere. Comfortably.</span></p></body></html></string>
+ </property>
+ <property name="scaledContents" >
+ <bool>true</bool>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="inputLine" />
+ <widget class="InputLine" name="inputLine" />
</item>
</layout>
</widget>
<extends>QPushButton</extends>
<header>topicbar.h</header>
</customwidget>
+ <customwidget>
+ <class>InputLine</class>
+ <extends>QLineEdit</extends>
+ <header>inputline.h</header>
+ </customwidget>
</customwidgets>
+ <tabstops>
+ <tabstop>inputLine</tabstop>
+ <tabstop>topicBar</tabstop>
+ </tabstops>
<resources/>
<connections/>
</ui>