X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=aeca91e9df2a3c89e64b54b23d7bf3e2696fac11;hb=d6b056e936ec441258d291b7a8af7b83f9f53016;hp=4bd2c96f4b472ec2494e7df19855bd96d855992e;hpb=70706ff642683d03ff091cab25d984ec7d9612de;p=quassel.git
diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp
index 4bd2c96f..aeca91e9 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,6 +24,7 @@
#include "chatline-old.h"
#include "client.h"
#include "coreconnectdlg.h"
+#include "nicklistwidget.h"
#include "serverlist.h"
#include "settingsdlg.h"
//#include "settingspage.h"
@@ -68,6 +69,18 @@ void MainWin::init() {
setupMenus();
setupViews();
+ // create nick dock
+ nickDock = new QDockWidget("Nicks", this);
+ nickDock->setObjectName("NickDock");
+ nickDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+
+ nickListWidget = new NickListWidget(nickDock);
+ nickDock->setWidget(nickListWidget);
+
+ addDockWidget(Qt::RightDockWidgetArea, nickDock);
+ ui.menuViews->addAction(nickDock->toggleViewAction());
+
+ // restore mainwin state
QSettings s;
s.beginGroup("Geometry");
//resize(s.value("MainWinSize", QSize(500, 400)).toSize());
@@ -139,9 +152,6 @@ void MainWin::setupMenus() {
connect(ui.actionSettingsDlg, SIGNAL(triggered()), this, SLOT(showSettingsDlg()));
ui.actionSettingsDlg->setEnabled(false);
connect(ui.actionAboutQt, SIGNAL(triggered()), QApplication::instance(), SLOT(aboutQt()));
- // for debugging
- connect(ui.actionImportBacklog, SIGNAL(triggered()), this, SLOT(importBacklog()));
- Client::signalProxy()->attachSignal(this, SIGNAL(importOldBacklog()));
}
void MainWin::setupViews() {
@@ -187,6 +197,7 @@ void MainWin::connectedToCore() {
ui.actionDisconnectCore->setEnabled(true);
ui.actionNetworkList->setEnabled(true);
ui.bufferWidget->show();
+ statusBar()->showMessage(tr("Connected to core."));
}
void MainWin::disconnectedFromCore() {
@@ -196,7 +207,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) {
@@ -259,15 +271,9 @@ void MainWin::showBuffer(Buffer *b) {
currentBuffer = b->bufferInfo().groupId();
//emit bufferSelected(b);
//qApp->processEvents();
-
ui.bufferWidget->setBuffer(b);
+ nickListWidget->setBuffer(b);
+ //if(b->bufferType() == Buffer::ChannelType) nickDock->show();
+ //else nickDock->hide();
//emit bufferSelected(b);
}
-
-void MainWin::importBacklog() {
- if(QMessageBox::warning(this, "Import old backlog?", "Do you want to import your old file-based backlog into new the backlog database?
"
- "This will permanently delete the contents of your database!",
- QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes) {
- emit importOldBacklog();
- }
-}