X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=75f2c8393cbb9545c176dbc9a462b09d1cb1d587;hp=fe050fb392cfcc258bd3b5be5a3b736e581553f1;hb=d98055b722222402eaa0543dacd133b9e3eaa52e;hpb=5ba28fb36a747bd9a2c05a58f0533d1e38c2a0de diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index fe050fb3..75f2c839 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-09 by the Quassel Project * + * Copyright (C) 2005-2010 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -189,13 +189,14 @@ void MainWin::init() { setupHotList(); #ifndef HAVE_KDE - QtUi::registerNotificationBackend(new TaskbarNotificationBackend(this)); -# ifndef QT_NO_SYSTEMTRAYICON - QtUi::registerNotificationBackend(new SystrayNotificationBackend(this)); -# endif # ifdef HAVE_PHONON QtUi::registerNotificationBackend(new PhononNotificationBackend(this)); # endif +# ifndef QT_NO_SYSTEMTRAYICON + QtUi::registerNotificationBackend(new SystrayNotificationBackend(this)); +# endif + + QtUi::registerNotificationBackend(new TaskbarNotificationBackend(this)); #else /* HAVE_KDE */ QtUi::registerNotificationBackend(new KNotificationBackend(this)); @@ -246,6 +247,9 @@ void MainWin::saveStateToSettings(UiSettings &s) { s.setValue("MainWinMinimized", isMinimized()); s.setValue("MainWinMaximized", isMaximized()); s.setValue("MainWinHidden", !isVisible()); + BufferId lastBufId = Client::bufferModel()->currentBuffer(); + if(lastBufId.isValid()) + s.setValue("LastUsedBufferId", lastBufId.toInt()); #ifdef HAVE_KDE saveAutoSaveSettings(); @@ -750,6 +754,12 @@ void MainWin::setConnectedState() { IrcConnectionWizard *wizard = new IrcConnectionWizard(this, Qt::Sheet); wizard->show(); } + else { + QtUiSettings s; + BufferId lastUsedBufferId(s.value("LastUsedBufferId").toInt()); + if(lastUsedBufferId.isValid()) + Client::bufferModel()->switchToBuffer(lastUsedBufferId); + } } void MainWin::loadLayout() { @@ -757,9 +767,9 @@ void MainWin::loadLayout() { int accountId = Client::currentCoreAccount().accountId().toInt(); QByteArray state = s.value(QString("MainWinState-%1").arg(accountId)).toByteArray(); if(state.isEmpty()) { - // Make sure that the default bufferview is shown - if(_bufferViews.count()) - _bufferViews.at(0)->show(); + foreach(BufferViewDock *view, _bufferViews) + view->show(); + _layoutLoaded = true; return; } @@ -1179,4 +1189,3 @@ void MainWin::on_actionDebugLog_triggered() { void MainWin::showStatusBarMessage(const QString &message) { statusBar()->showMessage(message, 10000); } -