1 /***************************************************************************
2 * Copyright (C) 2005-07 by The Quassel IRC Development Team *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #include "qtopiamainwin.h"
23 #include "coreconnectdlg.h"
26 #include "qtopiagui.h"
27 #include "signalproxy.h"
29 // This constructor is the first thing to be called for a Qtopia app, so we do the init stuff
30 // here (rather than in a main.cpp).
31 QtopiaMainWin::QtopiaMainWin(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags) {
32 qRegisterMetaType<QVariant>("QVariant");
33 qRegisterMetaType<Message>("Message");
34 qRegisterMetaType<BufferId>("BufferId");
35 qRegisterMetaTypeStreamOperators<QVariant>("QVariant");
36 qRegisterMetaTypeStreamOperators<Message>("Message");
37 qRegisterMetaTypeStreamOperators<BufferId>("BufferId");
39 Global::runMode = Global::ClientOnly;
41 QCoreApplication::setOrganizationDomain("quassel-irc.org");
42 QCoreApplication::setApplicationName("Quassel IRC");
43 QCoreApplication::setOrganizationName("Quassel IRC Development Team");
46 QtopiaGui *gui = new QtopiaGui(this);
51 setWindowTitle("Quassel IRC");
52 //setWindowTitle(QString::fromUtf8("Κυασελ Εγαρζη"));
53 setWindowIcon(QIcon(":/qirc-icon.png"));
54 setWindowIconText("Quassel IRC");
58 // at this point, client is fully initialized
59 void QtopiaMainWin::init() {
60 Client::signalProxy()->attachSignal(this, SIGNAL(requestBacklog(BufferId, QVariant, QVariant)));
62 CoreConnectDlg *dlg = new CoreConnectDlg(this);
63 //setCentralWidget(dlg);
68 QtopiaMainWin::~QtopiaMainWin() {
73 void QtopiaMainWin::connectedToCore() {
74 foreach(BufferId id, Client::allBufferIds()) {
75 emit requestBacklog(id, 100, -1);
79 void QtopiaMainWin::disconnectedFromCore() {
84 AbstractUiMsg *QtopiaMainWin::layoutMsg(const Message &msg) {
85 //return new ChatLine(msg);