X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fqtui%2Fmainwin.cpp;h=91cc9d3039fce9cadb2ed42cade40e74776a5975;hb=788fd0058595c815dc42597e9956c02aea45261f;hp=a815df9b2d7a4d457dd46bb220baf2db3081ae8b;hpb=fb1c465a71b110984d59722bbf0ed873674daf94;p=quassel.git diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index a815df9b..91cc9d30 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 * @@ -27,7 +27,6 @@ #include "nicklistwidget.h" #include "serverlist.h" #include "settingsdlg.h" -//#include "settingspage.h" #include "signalproxy.h" #include "topicwidget.h" @@ -35,6 +34,10 @@ #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"); @@ -45,7 +48,7 @@ MainWin::MainWin(QtUi *_gui, QWidget *parent) : QMainWindow(parent), gui(_gui) { statusBar()->showMessage(tr("Waiting for core...")); serverListDlg = new ServerListDlg(this); settingsDlg = new SettingsDlg(this); - + debugConsole = new DebugConsole(this); } void MainWin::init() { @@ -68,6 +71,7 @@ void MainWin::init() { setupMenus(); setupViews(); + setupSettingsDlg(); // create nick dock nickDock = new QDockWidget("Nicks", this); @@ -104,7 +108,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 +124,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 +158,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 +186,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 +195,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); @@ -207,6 +221,7 @@ void MainWin::disconnectedFromCore() { ui.actionNetworkList->setEnabled(false); ui.bufferWidget->hide(); ui.actionConnectCore->setEnabled(true); + nickListWidget->reset(); statusBar()->showMessage(tr("Not connected to core.")); } @@ -241,6 +256,10 @@ void MainWin::showSettingsDlg() { settingsDlg->show(); } +void MainWin::showDebugConsole() { + debugConsole->show(); +} + void MainWin::closeEvent(QCloseEvent *event) { //if (userReallyWantsToQuit()) {