#include "action.h"
#include "actioncollection.h"
#include "buffermodel.h"
+#include "bufferview.h"
#include "bufferviewmanager.h"
#include "bufferwidget.h"
#include "channellistdlg.h"
#include "clientbacklogmanager.h"
#include "coreinfodlg.h"
#include "coreconnectdlg.h"
+#include "debuglogwidget.h"
+#include "debugmessagemodelfilter.h"
#include "iconloader.h"
#include "inputwidget.h"
+#include "inputline.h"
#include "irclistmodel.h"
#include "jumpkeyhandler.h"
#include "msgprocessorstatuswidget.h"
#include "settingspages/aliasessettingspage.h"
#include "settingspages/appearancesettingspage.h"
+#include "settingspages/backlogsettingspage.h"
#include "settingspages/bufferviewsettingspage.h"
#include "settingspages/colorsettingspage.h"
#include "settingspages/fontssettingspage.h"
QtUiSettings uiSettings;
QString style = uiSettings.value("Style", QString()).toString();
if(!style.isEmpty()) {
- QApplication::setStyle("plastique");
+ QApplication::setStyle(style);
}
+ QApplication::setQuitOnLastWindowClosed(false);
+
setWindowTitle("Quassel IRC");
setWindowIconText("Quassel IRC");
updateIcon();
connect(QApplication::instance(), SIGNAL(aboutToQuit()), SLOT(saveLayout()));
connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), SLOT(clientNetworkCreated(NetworkId)));
connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), SLOT(clientNetworkRemoved(NetworkId)));
+ connect(Client::mainUi()->actionProvider(), SIGNAL(showChannelList(NetworkId)), SLOT(showChannelList(NetworkId)));
// Setup Dock Areas
setDockNestingEnabled(true);
setDisconnectedState(); // Disable menus and stuff
show();
-
showCoreConnectionDlg(true); // autoconnect if appropriate
}
// Help
coll->addAction("AboutQuassel", new Action(SmallIcon("quassel"), tr("&About Quassel..."), coll,
this, SLOT(showAboutDlg())));
- coll->addAction("AboutQt", new Action(tr("About &Qt..."), coll,
+ coll->addAction("AboutQt", new Action(QIcon(":/pics/qt-logo.png"), tr("About &Qt..."), coll,
qApp, SLOT(aboutQt())));
coll->addAction("DebugNetworkModel", new Action(SmallIcon("tools-report-bug"), tr("Debug &NetworkModel"), coll,
this, SLOT(on_actionDebugNetworkModel_triggered())));
+ coll->addAction("DebugMessageModel", new Action(SmallIcon("tools-report-bug"), tr("Debug &MessageModel"), coll,
+ this, SLOT(on_actionDebugMessageModel_triggered())));
+ coll->addAction("DebugLog", new Action(SmallIcon("tools-report-bug"), tr("Debug &Log"), coll,
+ this, SLOT(on_actionDebugLog_triggered())));
}
void MainWin::setupMenus() {
_helpMenu->addSeparator();
_helpDebugMenu = _helpMenu->addMenu(SmallIcon("tools-report-bug"), tr("Debug"));
_helpDebugMenu->addAction(coll->action("DebugNetworkModel"));
+ _helpDebugMenu->addAction(coll->action("DebugMessageModel"));
+ _helpDebugMenu->addAction(coll->action("DebugLog"));
}
void MainWin::setupBufferWidget() {
view->setFilteredModel(Client::bufferModel(), config);
view->show();
- connect(&view->showChannelList, SIGNAL(triggered()), this, SLOT(showChannelList()));
-
Client::bufferModel()->synchronizeView(view);
dock->setWidget(view);
addDockWidget(Qt::LeftDockWidgetArea, dock);
_bufferViewsMenu->addAction(dock->toggleViewAction());
- _netViews.append(dock);
+ _bufferViews.append(dock);
}
void MainWin::removeBufferView(int bufferViewConfigId) {
}
}
+BufferView *MainWin::allBuffersView() const {
+ // "All Buffers" is always the first dock created
+ if(_bufferViews.count() > 0)
+ return _bufferViews[0]->bufferView();
+ return 0;
+}
+
void MainWin::on_actionEditNetworks_triggered() {
SettingsPageDlg dlg(new NetworksSettingsPage(this), this);
dlg.exec();
inputWidget->setSelectionModel(Client::bufferModel()->standardSelectionModel());
_bufferWidget->setFocusProxy(inputWidget);
+
+ inputWidget->inputLine()->installEventFilter(_bufferWidget);
}
void MainWin::setupTopicWidget() {
connect(showStatusbar, SIGNAL(toggled(bool)), statusBar(), SLOT(setVisible(bool)));
connect(showStatusbar, SIGNAL(toggled(bool)), this, SLOT(saveStatusBarStatus(bool)));
+
+ connect(Client::backlogManager(), SIGNAL(messagesRequested(const QString &)), this, SLOT(showStatusBarMessage(const QString &)));
+ connect(Client::backlogManager(), SIGNAL(messagesProcessed(const QString &)), this, SLOT(showStatusBarMessage(const QString &)));
}
void MainWin::saveStatusBarStatus(bool enabled) {
connect(Client::bufferViewManager(), SIGNAL(bufferViewConfigAdded(int)), this, SLOT(addBufferView(int)));
connect(Client::bufferViewManager(), SIGNAL(bufferViewConfigDeleted(int)), this, SLOT(removeBufferView(int)));
connect(Client::bufferViewManager(), SIGNAL(initDone()), this, SLOT(loadLayout()));
-
- Client::backlogManager()->requestInitialBacklog();
+
setConnectedState();
}
dlg->registerSettingsPage(new AppearanceSettingsPage(dlg)); //General
//Category: Behaviour
dlg->registerSettingsPage(new GeneralSettingsPage(dlg));
+ dlg->registerSettingsPage(new BacklogSettingsPage(dlg));
dlg->registerSettingsPage(new HighlightSettingsPage(dlg));
dlg->registerSettingsPage(new AliasesSettingsPage(dlg));
dlg->registerSettingsPage(new NotificationsSettingsPage(dlg));
event->ignore();
} else {
event->accept();
+ QApplication::quit();
}
}
view->show();
}
+void MainWin::on_actionDebugMessageModel_triggered() {
+ QTableView *view = new QTableView(0);
+ DebugMessageModelFilter *filter = new DebugMessageModelFilter(view);
+ filter->setSourceModel(Client::messageModel());
+ view->setModel(filter);
+ view->setAttribute(Qt::WA_DeleteOnClose, true);
+ view->verticalHeader()->hide();
+ view->horizontalHeader()->setStretchLastSection(true);
+ view->show();
+}
+
+void MainWin::on_actionDebugLog_triggered() {
+ DebugLogWidget *logWidget = new DebugLogWidget(0);
+ logWidget->show();
+}
+
void MainWin::saveStateToSession(const QString &sessionId) {
return;
SessionSettings s(sessionId);
s.setValue("MainWinPos", pos());
s.setValue("MainWinState", saveState());
}
+
+void MainWin::showStatusBarMessage(const QString &message) {
+ statusBar()->showMessage(message, 10000);
+}