We don't get unnecessary show events anymore on mainwin state restore, so we
need to make sure that docks are not shown before we load the layout.
sslLabel(new QLabel()),
msgProcessorStatusWidget(new MsgProcessorStatusWidget()),
_titleSetter(this),
sslLabel(new QLabel()),
msgProcessorStatusWidget(new MsgProcessorStatusWidget()),
_titleSetter(this),
+ _awayLog(0),
+ _layoutLoaded(false)
{
#ifdef Q_WS_WIN
dwTickCount = 0;
{
#ifdef Q_WS_WIN
dwTickCount = 0;
BufferView *view = new BufferView(dock);
view->setFilteredModel(Client::bufferModel(), config);
view->installEventFilter(_inputWidget); // for key presses
BufferView *view = new BufferView(dock);
view->setFilteredModel(Client::bufferModel(), config);
view->installEventFilter(_inputWidget); // for key presses
Client::bufferModel()->synchronizeView(view);
dock->setWidget(view);
Client::bufferModel()->synchronizeView(view);
dock->setWidget(view);
+ dock->setVisible(_layoutLoaded); // don't show before state has been restored
addDockWidget(Qt::LeftDockWidgetArea, dock);
_bufferViewsMenu->addAction(dock->toggleViewAction());
addDockWidget(Qt::LeftDockWidgetArea, dock);
_bufferViewsMenu->addAction(dock->toggleViewAction());
dock = qobject_cast<BufferViewDock *>(action->parent());
if(dock && actionData.toInt() == bufferViewConfigId) {
removeAction(action);
dock = qobject_cast<BufferViewDock *>(action->parent());
if(dock && actionData.toInt() == bufferViewConfigId) {
removeAction(action);
+ _bufferViews.removeAll(dock);
QtUiSettings s;
int accountId = Client::currentCoreAccount().toInt();
restoreState(s.value(QString("MainWinState-%1").arg(accountId)).toByteArray(), accountId);
QtUiSettings s;
int accountId = Client::currentCoreAccount().toInt();
restoreState(s.value(QString("MainWinState-%1").arg(accountId)).toByteArray(), accountId);
}
void MainWin::saveLayout() {
}
void MainWin::saveLayout() {
void MainWin::disconnectedFromCore() {
// save core specific layout and remove bufferviews;
saveLayout();
void MainWin::disconnectedFromCore() {
// save core specific layout and remove bufferviews;
saveLayout();
+ _layoutLoaded = false;
+
QVariant actionData;
BufferViewDock *dock;
foreach(QAction *action, _bufferViewsMenu->actions()) {
QVariant actionData;
BufferViewDock *dock;
foreach(QAction *action, _bufferViewsMenu->actions()) {
dock = qobject_cast<BufferViewDock *>(action->parent());
if(dock && actionData.toInt() != -1) {
removeAction(action);
dock = qobject_cast<BufferViewDock *>(action->parent());
if(dock && actionData.toInt() != -1) {
removeAction(action);
+ _bufferViews.removeAll(dock);
QtUiSettings s;
restoreState(s.value("MainWinState").toByteArray());
setDisconnectedState();
QtUiSettings s;
restoreState(s.value("MainWinState").toByteArray());
setDisconnectedState();
QSize _normalSize; //!< Size of the non-maximized window
QPoint _normalPos; //!< Position of the non-maximized window
QSize _normalSize; //!< Size of the non-maximized window
QPoint _normalPos; //!< Position of the non-maximized window