# include <KShortcutsDialog>
# include <KStatusBar>
# include <KToolBar>
+# include <KWindowSystem>
#endif
#ifdef Q_WS_X11
# include "knotificationbackend.h"
#endif /* HAVE_KDE */
+#ifdef HAVE_INDICATEQT
+ #include "indicatornotificationbackend.h"
+#endif
+
#include "settingspages/aliasessettingspage.h"
#include "settingspages/appearancesettingspage.h"
#include "settingspages/backlogsettingspage.h"
sslLabel(new QLabel()),
msgProcessorStatusWidget(new MsgProcessorStatusWidget()),
_titleSetter(this),
- _awayLog(0)
+ _awayLog(0),
+ _layoutLoaded(false)
{
#ifdef Q_WS_WIN
dwTickCount = 0;
QtUi::registerNotificationBackend(new KNotificationBackend(this));
#endif /* HAVE_KDE */
+#ifdef HAVE_INDICATEQT
+ QtUi::registerNotificationBackend(new IndicatorNotificationBackend(this));
+#endif
+
connect(bufferWidget(), SIGNAL(currentChanged(BufferId)), SLOT(currentBufferChanged(BufferId)));
setDisconnectedState(); // Disable menus and stuff
BufferView *view = new BufferView(dock);
view->setFilteredModel(Client::bufferModel(), config);
view->installEventFilter(_inputWidget); // for key presses
- view->show();
Client::bufferModel()->synchronizeView(view);
dock->setWidget(view);
- dock->show();
+ dock->setVisible(_layoutLoaded); // don't show before state has been restored
addDockWidget(Qt::LeftDockWidgetArea, dock);
_bufferViewsMenu->addAction(dock->toggleViewAction());
dock = qobject_cast<BufferViewDock *>(action->parent());
if(dock && actionData.toInt() == bufferViewConfigId) {
removeAction(action);
+ _bufferViews.removeAll(dock);
dock->deleteLater();
}
}
QtUiSettings s;
int accountId = Client::currentCoreAccount().toInt();
restoreState(s.value(QString("MainWinState-%1").arg(accountId)).toByteArray(), accountId);
+ _layoutLoaded = true;
}
void MainWin::saveLayout() {
void MainWin::disconnectedFromCore() {
// save core specific layout and remove bufferviews;
saveLayout();
+ _layoutLoaded = false;
+
QVariant actionData;
BufferViewDock *dock;
foreach(QAction *action, _bufferViewsMenu->actions()) {
dock = qobject_cast<BufferViewDock *>(action->parent());
if(dock && actionData.toInt() != -1) {
removeAction(action);
+ _bufferViews.removeAll(dock);
dock->deleteLater();
}
}
+
QtUiSettings s;
restoreState(s.value("MainWinState").toByteArray());
setDisconnectedState();
}
void MainWin::forceActivated() {
+#ifdef HAVE_KDE
+ show();
+ KWindowSystem::forceActiveWindow(winId());
+#else
+
#ifdef Q_WS_X11
// Bypass focus stealing prevention
QX11Info::setAppUserTime(QX11Info::appTime());
show();
raise();
activateWindow();
+#endif /* HAVE_KDE */
}
void MainWin::messagesInserted(const QModelIndex &parent, int start, int end) {