No more crashing on text input.
Is it can be sleepsy tiem now?
12 files changed:
desktop.hint=nct desktop
pics.files=../src/images/qirc-icon.png
desktop.hint=nct desktop
pics.files=../src/images/qirc-icon.png
-pics.path=/pics/quasselirc/
+pics.path=/pics/quasselirc
pics.hint=pics
#help.source=help
#help.files=example.html
#help.hint=help
pics.hint=pics
#help.source=help
#help.files=example.html
#help.hint=help
pkg.name=QuasselTopia
pkg.desc=Quassel IRC, a next-gen IRC client
pkg.name=QuasselTopia
pkg.desc=Quassel IRC, a next-gen IRC client
BufferViewWidget::BufferViewWidget(QWidget *parent) : QDialog(parent) {
ui.setupUi(this);
setModal(true);
BufferViewWidget::BufferViewWidget(QWidget *parent) : QDialog(parent) {
ui.setupUi(this);
setModal(true);
- setStyleSheet("background-color: rgba(255, 255, 255, 40%); color: rgb(0, 0, 0); font-size: 5pt;");
+ setStyleSheet("background-color: rgba(220, 220, 255, 40%); color: rgb(0, 0, 0); font-size: 5pt;");
//ui.tabWidget->tabBar()->setStyleSheet("font-size: 5pt;");
// get rid of the default tab page designer forces upon us :(
//ui.tabWidget->tabBar()->setStyleSheet("font-size: 5pt;");
// get rid of the default tab page designer forces upon us :(
MainWidget::MainWidget(QWidget *parent) : QWidget(parent) {
ui.setupUi(this);
MainWidget::MainWidget(QWidget *parent) : QWidget(parent) {
ui.setupUi(this);
+ ui.inputLine->hide(); ui.topicBar->hide();
connect(ui.inputLine, SIGNAL(returnPressed()), this, SLOT(enterPressed()));
currentBuffer = 0;
}
connect(ui.inputLine, SIGNAL(returnPressed()), this, SLOT(enterPressed()));
currentBuffer = 0;
}
chatWidgets.insert(buf, chatWidget);
chatWidget->setFocusProxy(ui.inputLine);
} else chatWidget = chatWidgets[buf];
chatWidgets.insert(buf, chatWidget);
chatWidget->setFocusProxy(ui.inputLine);
} else chatWidget = chatWidgets[buf];
+ ui.inputLine->show(); ui.topicBar->show();
ui.stack->setCurrentWidget(chatWidget);
ui.inputLine->setFocus();
currentBuffer = buf;
ui.stack->setCurrentWidget(chatWidget);
ui.inputLine->setFocus();
currentBuffer = buf;
***************************************************************************/
#include "nicklistwidget.h"
***************************************************************************/
#include "nicklistwidget.h"
-//#include "nicktreemodel.h"
+
+#include "buffer.h"
+#include "nickview.h"
NickListWidget::NickListWidget(QWidget *parent) : QDialog(parent) {
ui.setupUi(this);
NickListWidget::NickListWidget(QWidget *parent) : QDialog(parent) {
ui.setupUi(this);
+ setModal(true);
+ setStyleSheet("background-color: rgba(220, 220, 255, 40%); color: rgb(0, 0, 0); font-size: 5pt;");
-void NickListWidget::setNickModel(NickTreeModel *model) {
- //ui.nickView->setModel(model);
+void NickListWidget::setBuffer(Buffer *buf) {
+ if(!buf) {
+ ui.stackedWidget->setCurrentWidget(ui.emptyPage);
+ return;
+ }
+ if(buf->bufferType() != Buffer::ChannelType) {
+ ui.stackedWidget->setCurrentWidget(ui.emptyPage);
+ } else {
+ if(nickViews.contains(buf)) {
+ ui.stackedWidget->setCurrentWidget(nickViews.value(buf));
+ } else {
+ NickView *view = new NickView(this);
+ view->setModel(buf->nickModel());
+ nickViews[buf] = view;
+ ui.stackedWidget->addWidget(view);
+ ui.stackedWidget->setCurrentWidget(view);
+ }
+ }
+}
+void NickListWidget::reset() {
+ foreach(NickView *view, nickViews.values()) {
+ ui.stackedWidget->removeWidget(view);
+ view->deleteLater();
+ }
#include "ui_nicklistwidget.h"
#include "ui_nicklistwidget.h"
+class Buffer;
+class NickView;
class NickListWidget : public QDialog {
Q_OBJECT
class NickListWidget : public QDialog {
Q_OBJECT
~NickListWidget();
public slots:
~NickListWidget();
public slots:
- void setNickModel(NickTreeModel *model);
+ void setBuffer(Buffer *);
+ void reset();
private:
Ui::NickListWidget ui;
private:
Ui::NickListWidget ui;
+ QHash<Buffer *, NickView *> nickViews;
#include "signalproxy.h"
#include <Qtopia>
#include "signalproxy.h"
#include <Qtopia>
+#include <QSoftMenuBar>
+
+#define DEBUGMODE
// This constructor is the first thing to be called for a Qtopia app, so we do the init stuff
// here (rather than in a main.cpp).
// This constructor is the first thing to be called for a Qtopia app, so we do the init stuff
// here (rather than in a main.cpp).
+void QtopiaMainWin::closeEvent(QCloseEvent *event) {
+#ifndef DEBUGMODE
+ QMessageBox *box = new QMessageBox(QMessageBox::Question, tr("Quit Quassel IRC?"), tr("Do you really want to quit Quassel IRC?"),
+ QMessageBox::Cancel, this);
+ QAbstractButton *quit = box->addButton(tr("Quit"), QMessageBox::AcceptRole);
+ box->exec();
+ if(box->clickedButton() == quit) event->accept();
+ else event->ignore();
+ box->deleteLater();
+#else
+ event->accept();
+#endif
+}
+
void QtopiaMainWin::setupActions() {
showBuffersAction = toolBar->addAction(QIcon(":icon/options-hide"), "Show Buffers", this, SLOT(showBufferView())); // FIXME provide real icon
showNicksAction = toolBar->addAction(QIcon(":icon/list"), "Show Nicks", this, SLOT(showNickList()));
void QtopiaMainWin::setupActions() {
showBuffersAction = toolBar->addAction(QIcon(":icon/options-hide"), "Show Buffers", this, SLOT(showBufferView())); // FIXME provide real icon
showNicksAction = toolBar->addAction(QIcon(":icon/list"), "Show Nicks", this, SLOT(showNickList()));
+ QMenu *menu = new QMenu(this);
+ menu->addAction(showBuffersAction);
+ menu->addAction(showNicksAction);
+ QSoftMenuBar::addMenuTo(this, menu);
}
void QtopiaMainWin::connectedToCore() {
foreach(BufferInfo id, Client::allBufferInfos()) {
emit requestBacklog(id, 100, -1);
}
}
void QtopiaMainWin::connectedToCore() {
foreach(BufferInfo id, Client::allBufferInfos()) {
emit requestBacklog(id, 100, -1);
}
// FIXME just for testing: select first available buffer
if(Client::allBufferInfos().count() > 1) {
Buffer *b = Client::buffer(Client::allBufferInfos()[1]);
Client::bufferModel()->selectBuffer(b);
}
// FIXME just for testing: select first available buffer
if(Client::allBufferInfos().count() > 1) {
Buffer *b = Client::buffer(Client::allBufferInfos()[1]);
Client::bufferModel()->selectBuffer(b);
}
}
void QtopiaMainWin::disconnectedFromCore() {
}
void QtopiaMainWin::disconnectedFromCore() {
void QtopiaMainWin::showBuffer(Buffer *b) {
mainWidget->setBuffer(b);
bufferViewWidget->hide();
void QtopiaMainWin::showBuffer(Buffer *b) {
mainWidget->setBuffer(b);
bufferViewWidget->hide();
+ nickListWidget->setBuffer(b);
void showBufferView();
void showNickList();
void showBufferView();
void showNickList();
+ protected:
+ void closeEvent(QCloseEvent *);
+
private:
void init();
void setupActions();
private:
void init();
void setupActions();
[Desktop Entry]
Comment[]=A Next-Gen IRC Client
Exec=quasseltopia
[Desktop Entry]
Comment[]=A Next-Gen IRC Client
Exec=quasseltopia
-Icon=/pics/quasselirc/qirc-icon.png
+Icon=quasselirc/qirc-icon
Type=Application
Name[]=QuasselTopia
Type=Application
Name[]=QuasselTopia
<number>0</number>
</property>
<widget class="QWidget" name="page" >
<number>0</number>
</property>
<widget class="QWidget" name="page" >
+ <property name="styleSheet" >
+ <string>background-color: rgba(220, 220, 255, 40%)</string>
+ </property>
<layout class="QVBoxLayout" >
<item>
<widget class="QLabel" name="label" >
<layout class="QVBoxLayout" >
<item>
<widget class="QLabel" name="label" >
<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;">
<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>
+<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:#00008b;">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; color:#00008b;">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:#000000;">Chat comfortably. Anywhere.</span></p></body></html></string>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
<property name="scaledContents" >
<bool>true</bool>
<x>0</x>
<y>0</y>
<width>240</width>
<x>0</x>
<y>0</y>
<width>240</width>
</rect>
</property>
<property name="windowTitle" >
<string>Nicks in Channel</string>
</property>
<layout class="QVBoxLayout" >
</rect>
</property>
<property name="windowTitle" >
<string>Nicks in Channel</string>
</property>
<layout class="QVBoxLayout" >
- <property name="leftMargin" >
- <number>1</number>
- </property>
- <property name="topMargin" >
- <number>1</number>
- </property>
- <property name="rightMargin" >
- <number>1</number>
- </property>
- <property name="bottomMargin" >
- <number>1</number>
- </property>
- <widget class="NickView" name="nickView" />
+ <widget class="QStackedWidget" name="stackedWidget" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="emptyPage" />
+ </widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
- <customwidgets>
- <customwidget>
- <class>NickView</class>
- <extends>QTreeView</extends>
- <header>nickview.h</header>
- </customwidget>
- </customwidgets>
<resources/>
<connections/>
</ui>
<resources/>
<connections/>
</ui>
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-07 by The Quassel 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 *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
bool InputLine::event(QEvent *e) {
if(e->type() == QEvent::KeyPress) {
bool InputLine::event(QEvent *e) {
if(e->type() == QEvent::KeyPress) {
- keyPressEvent(dynamic_cast<QKeyEvent*>(e));
+ keyPressEvent(static_cast<QKeyEvent*>(e));
return true;
}
return QLineEdit::event(e);
return true;
}
return QLineEdit::event(e);