X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=0f99020e7666e767ae10883c827f11da27d8d3d8;hp=923a3849676d62d9483832e7f5efe2e501d31a85;hb=3497660529f9fa912f4d46ca2da9e0c97310076c;hpb=8b8ec8597367d13527e9e7a46e184ee99a7d5f32 diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 923a3849..0f99020e 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -203,6 +203,7 @@ void MainWin::init() connect(Client::messageModel(), SIGNAL(rowsInserted(const QModelIndex &, int, int)), SLOT(messagesInserted(const QModelIndex &, int, int))); connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showChannelList(NetworkId)), SLOT(showChannelList(NetworkId))); + connect(Client::instance(), SIGNAL(showChannelList(NetworkId)), SLOT(showChannelList(NetworkId))); connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString))); connect(Client::instance(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString))); @@ -656,6 +657,8 @@ void MainWin::addBufferView(ClientBufferViewConfig *config) Client::bufferModel()->synchronizeView(view); + dock->setLocked(QtUiSettings().value("LockLayout", false).toBool()); + dock->setWidget(view); dock->setVisible(_layoutLoaded); // don't show before state has been restored @@ -774,7 +777,7 @@ void MainWin::changeActiveBufferView(int bufferViewId) void MainWin::showPasswordChangeDlg() { - if((Client::coreFeatures() & Quassel::PasswordChange)) { + if(Client::isCoreFeatureEnabled(Quassel::Feature::PasswordChange)) { PasswordChangeDlg dlg(this); dlg.exec(); } @@ -883,11 +886,26 @@ void MainWin::on_actionLockLayout_toggled(bool lock) foreach(VerticalDock *dock, docks) { dock->showTitle(!lock); } + + QList nickdocks = findChildren(); + foreach(NickListDock *nickdock, nickdocks) { + nickdock->setLocked(lock); + } + + QList bufferdocks = findChildren(); + foreach(BufferViewDock *bufferdock, bufferdocks) { + bufferdock->setLocked(lock); + } + if (Client::bufferViewManager()) { foreach(ClientBufferViewConfig *config, Client::bufferViewManager()->clientBufferViewConfigs()) { config->setLocked(lock); } } + + _mainToolBar->setMovable(!lock); + _nickToolBar->setMovable(!lock); + QtUiSettings().setValue("LockLayout", lock); } @@ -898,6 +916,7 @@ void MainWin::setupNickWidget() NickListDock *nickDock = new NickListDock(tr("Nicks"), this); nickDock->setObjectName("NickDock"); nickDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); + nickDock->setLocked(QtUiSettings().value("LockLayout", false).toBool()); _nickListWidget = new NickListWidget(nickDock); nickDock->setWidget(_nickListWidget); @@ -1094,6 +1113,8 @@ void MainWin::setupToolBars() _mainToolBar->addAction(coll->action("DisconnectCore")); } + _mainToolBar->setMovable(!QtUiSettings().value("LockLayout", false).toBool()); + QtUi::toolBarActionProvider()->addActions(_mainToolBar, ToolBarActionProvider::MainToolBar); _toolbarMenu->addAction(_mainToolBar->toggleViewAction()); @@ -1106,6 +1127,7 @@ void MainWin::setupToolBars() _nickToolBar->setWindowTitle(tr("Nick Toolbar")); _nickToolBar->setVisible(false); //default: not visible addToolBar(_nickToolBar); + _nickToolBar->setMovable(!QtUiSettings().value("LockLayout", false).toBool()); QtUi::toolBarActionProvider()->addActions(_nickToolBar, ToolBarActionProvider::NickToolBar); _toolbarMenu->addAction(_nickToolBar->toggleViewAction());