8625e0247654e8f224f88b533922e3f42e7ef2d6
[quassel.git] / src / qtopia / qtopiamainwin.cpp
1 /***************************************************************************
2  *   Copyright (C) 2005-07 by The Quassel IRC Development Team             *
3  *   devel@quassel-irc.org                                                 *
4  *                                                                         *
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.                                   *
9  *                                                                         *
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.                          *
14  *                                                                         *
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  ***************************************************************************/
20
21 #include "qtopiamainwin.h"
22
23 #include "global.h"
24 #include "message.h"
25 #include "qtopiagui.h"
26 #include "coreconnectdlg.h"
27
28 // This constructor is the first thing to be called for a Qtopia app, so we do the init stuff
29 // here (rather than in a main.cpp).
30 QtopiaMainWin::QtopiaMainWin(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags) {
31   qRegisterMetaType<QVariant>("QVariant");
32   qRegisterMetaType<Message>("Message");
33   qRegisterMetaType<BufferId>("BufferId");
34   qRegisterMetaTypeStreamOperators<QVariant>("QVariant");
35   qRegisterMetaTypeStreamOperators<Message>("Message");
36   qRegisterMetaTypeStreamOperators<BufferId>("BufferId");
37
38   Global::runMode = Global::ClientOnly;
39
40   QCoreApplication::setOrganizationDomain("quassel-irc.org");
41   QCoreApplication::setApplicationName("Quassel IRC");
42   QCoreApplication::setOrganizationName("Quassel IRC Development Team");
43
44   //Style::init();
45   QtopiaGui *gui = new QtopiaGui(this);
46   Client::init(gui);
47   //gui->init();
48
49   setWindowTitle("Quassel IRC");
50   //setWindowTitle(QString::fromUtf8("Κυασελ Εγαρζη"));
51   setWindowIcon(QIcon(":/qirc-icon.png"));
52   setWindowIconText("Quassel IRC");
53
54   CoreConnectDlg *dlg = new CoreConnectDlg(this);
55   //setCentralWidget(dlg);
56   dlg->showMaximized();
57   dlg->exec();
58 }
59
60 QtopiaMainWin::~QtopiaMainWin() {
61
62
63 }
64
65 void QtopiaMainWin::connectedToCore() {
66   foreach(BufferId id, Client::allBufferIds()) {
67     emit requestBacklog(id, 100, -1);
68   }
69 }
70
71 void QtopiaMainWin::disconnectedFromCore() {
72
73
74 }
75
76 AbstractUiMsg *QtopiaMainWin::layoutMsg(const Message &msg) {
77   //return new ChatLine(msg);
78   return 0;
79 }