X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=5e97426f4ff68fdfb935cf99a2b3010117a27605;hp=e8f515fd8156e2c787e9d42eb973526ca5729854;hb=a18660ee87e81b6f4072537be3aa10c93a243b2a;hpb=e671e9da1edaab37ec403f575979f9a92a766e9a diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index e8f515fd..5e97426f 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -1,11 +1,11 @@ /*************************************************************************** - * 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 * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * (at your option) version 3. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -24,10 +24,10 @@ #include "chatline-old.h" #include "client.h" #include "coreconnectdlg.h" +#include "networkmodel.h" #include "nicklistwidget.h" #include "serverlist.h" #include "settingsdlg.h" -//#include "settingspage.h" #include "signalproxy.h" #include "topicwidget.h" @@ -35,17 +35,21 @@ #include "selectionmodelsynchronizer.h" #include "mappedselectionmodel.h" +#include "settingspages/fontssettingspage.h" + +#include "debugconsole.h" + MainWin::MainWin(QtUi *_gui, QWidget *parent) : QMainWindow(parent), gui(_gui) { ui.setupUi(this); setWindowTitle("Quassel IRC"); //setWindowTitle(QString::fromUtf8("Κυασελ Εγαρζη")); - setWindowIcon(QIcon(":/qirc-icon.png")); + setWindowIcon(QIcon(":icons/quassel-icon.png")); setWindowIconText("Quassel IRC"); statusBar()->showMessage(tr("Waiting for core...")); serverListDlg = new ServerListDlg(this); settingsDlg = new SettingsDlg(this); - + debugConsole = new DebugConsole(this); } void MainWin::init() { @@ -68,6 +72,7 @@ void MainWin::init() { setupMenus(); setupViews(); + setupSettingsDlg(); // create nick dock nickDock = new QDockWidget("Nicks", this); @@ -104,7 +109,8 @@ void MainWin::init() { setDockNestingEnabled(true); - // TESTING + // new Topic Stuff... should be probably refactored out into a separate method + setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); @@ -119,12 +125,15 @@ void MainWin::init() { TopicWidget *topicwidget = new TopicWidget(dock); dock->setWidget(topicwidget); - Client::bufferModel()->mapProperty(0, Qt::DisplayRole, topicwidget, "topic"); + Client::networkModel()->mapProperty(1, Qt::DisplayRole, topicwidget, "topic"); addDockWidget(Qt::TopDockWidgetArea, dock); ui.menuViews->addAction(dock->toggleViewAction()); + //showSettingsDlg(); + + } MainWin::~MainWin() { @@ -150,13 +159,14 @@ void MainWin::setupMenus() { connect(ui.actionNetworkList, SIGNAL(triggered()), this, SLOT(showServerList())); connect(ui.actionEditIdentities, SIGNAL(triggered()), serverListDlg, SLOT(editIdentities())); connect(ui.actionSettingsDlg, SIGNAL(triggered()), this, SLOT(showSettingsDlg())); - ui.actionSettingsDlg->setEnabled(false); + connect(ui.actionDebug_Console, SIGNAL(triggered()), this, SLOT(showDebugConsole())); + //ui.actionSettingsDlg->setEnabled(false); connect(ui.actionAboutQt, SIGNAL(triggered()), QApplication::instance(), SLOT(aboutQt())); } void MainWin::setupViews() { - BufferTreeModel *model = Client::bufferModel(); + NetworkModel *model = Client::networkModel(); connect(model, SIGNAL(bufferSelected(Buffer *)), this, SLOT(showBuffer(Buffer *))); addBufferView(tr("All Buffers"), model, BufferViewFilter::AllNets, QList()); @@ -177,7 +187,7 @@ void MainWin::addBufferView(const QString &viewname, QAbstractItemModel *model, //create the view and initialize it's filter BufferView *view = new BufferView(dock); view->setFilteredModel(model, mode, nets); - Client::bufferModel()->synchronizeView(view); + Client::networkModel()->synchronizeView(view); dock->setWidget(view); addDockWidget(Qt::LeftDockWidgetArea, dock); @@ -186,9 +196,14 @@ void MainWin::addBufferView(const QString &viewname, QAbstractItemModel *model, netViews.append(dock); } +void MainWin::setupSettingsDlg() { + settingsDlg->registerSettingsPage(new FontsSettingsPage(settingsDlg)); + +} + void MainWin::connectedToCore() { foreach(BufferInfo id, Client::allBufferInfos()) { - emit requestBacklog(id, 100, -1); + emit requestBacklog(id, 1000, -1); } ui.menuViews->setEnabled(true); @@ -197,6 +212,7 @@ void MainWin::connectedToCore() { ui.actionDisconnectCore->setEnabled(true); ui.actionNetworkList->setEnabled(true); ui.bufferWidget->show(); + statusBar()->showMessage(tr("Connected to core.")); } void MainWin::disconnectedFromCore() { @@ -206,7 +222,8 @@ void MainWin::disconnectedFromCore() { ui.actionNetworkList->setEnabled(false); ui.bufferWidget->hide(); ui.actionConnectCore->setEnabled(true); - //qDebug() << "mainwin disconnected"; + nickListWidget->reset(); + statusBar()->showMessage(tr("Not connected to core.")); } AbstractUiMsg *MainWin::layoutMsg(const Message &msg) { @@ -240,6 +257,10 @@ void MainWin::showSettingsDlg() { settingsDlg->show(); } +void MainWin::showDebugConsole() { + debugConsole->show(); +} + void MainWin::closeEvent(QCloseEvent *event) { //if (userReallyWantsToQuit()) {