//----------------------------------------------------------------------------- // Function: TabDocument::setDocumentType() //----------------------------------------------------------------------------- void TabDocument::setDocumentType(QString const& type) { if (type.isEmpty()) { docType_ = ""; } else { docType_ = " [" + type + "]"; } updateTabTitle(); }
void PluginGeneratorGUI::validateFilterName( const QString& name,FilterGeneratorGUI* wid ) { QStringList ls; // int widind = getPageIndexOfWidget(wid); for(int ii = 0;ii < tabs->count();++ii) ls.push_back(tabs->tabText(ii)); QString res = UsefulGUIFunctions::changeNameIfAlreadyInList(name,ls); if (res != name) { updateTabTitle(res,wid); wid->setFilterName(res); } }
void TabsManager::onTitleChanged(ChatWidget *chatWidget) { kdebugf(); int chatIndex = TabDialog->indexOf(chatWidget); if (-1 == chatIndex || !chatWidget) return; updateTabTitle(chatWidget); //if (TabDialog->currentIndex() == chatIndex) //TabDialog->setWindowTitle(TabDialog->tabText(chatIndex)); kdebugf2(); }
void TabsManager::insertTab(ChatWidget *chatWidget) { kdebugf(); Title->addChatWidget(chatWidget); bool restoreChatGeometry = true; // jeśli jest otwarty chatwindow przypisany do chat to zostanie on zamknięty if (chatWidget->parentWidget()) { chatWidget->parentWidget()->deleteLater(); restoreChatGeometry = false; } ContactSet contacts = chatWidget->chat().contacts(); DetachedChats.removeAll(chatWidget->chat()); for (Action *action : m_attachTabAction->actions()) { if (action->context()->contacts() == contacts) action->setChecked(true); } // Ustawiam tytul karty w zaleznosci od tego czy mamy do czynienia z rozmowa czy z konferencja TabDialog->insertTab(TargetTabs, chatWidget, chatWidget->title()->blinkingIcon(), QString()); if (restoreChatGeometry) chatWidget->kaduRestoreGeometry(); updateTabTitle(chatWidget); TargetTabs = -1; connect(chatWidget->edit(), SIGNAL(keyPressed(QKeyEvent*, CustomInput*, bool&)), TabDialog, SLOT(chatKeyPressed(QKeyEvent*, CustomInput*, bool&))); connect(chatWidget->title(), SIGNAL(titleChanged(ChatWidget*)), this, SLOT(onTitleChanged(ChatWidget*))); CloseOtherTabsMenuAction->setEnabled(TabDialog->count() > 1); // unreadMessagesCountChanged(chatWidget); if (_isActiveWindow(TabDialog) && TabDialog->currentWidget() == chatWidget) emit chatWidgetActivated(chatWidget); kdebugf2(); }
void MainWindow::addChild(const QString& imageFileName) { if (!imageFileName.isEmpty()) { QString canonicalImageFileName = QFileInfo(imageFileName).canonicalFilePath(); for (int i = 0; i < tabWidget->count(); ++i) { ChildWidget* child = qobject_cast<ChildWidget*> (tabWidget->widget(i)); if (canonicalImageFileName == child->canonicalImageFileName()) { tabWidget->setCurrentIndex(i); return; } } ChildWidget* child = new ChildWidget(this); if (child->loadImage(imageFileName)) { statusBar()->showMessage(tr("File loaded"), 2000); tabWidget->setCurrentIndex(tabWidget->addTab(child, child->userFriendlyCurrentFile())); tabWidget->setTabToolTip(tabWidget->currentIndex(), imageFileName); connect(child, SIGNAL(boxChanged()), this, SLOT(updateCommandActions())); connect(child, SIGNAL(modifiedChanged()), this, SLOT(updateTabTitle())); connect(child, SIGNAL(modifiedChanged()), this, SLOT(updateSaveAction())); connect(child, SIGNAL(zoomRatioChanged(qreal)), this, SLOT(zoomRatioChanged(qreal))); connect(child, SIGNAL(statusBarMessage(QString)), this, SLOT(statusBarMessage(QString))); connect(child, SIGNAL(drawRectangleChoosen()), this, SLOT(updateCommandActions())); child->setZoomStatus(); // save path of open image file QSettings settings(QSettings::IniFormat, QSettings::UserScope, SETTING_ORGANIZATION, SETTING_APPLICATION); QString filePath = QFileInfo(imageFileName).absolutePath(); settings.setValue("last_path", filePath); QStringList files = settings.value("recentFileList").toStringList(); files.removeAll(imageFileName); files.prepend(imageFileName); while (files.size() > MaxRecentFiles) files.removeLast(); settings.setValue("recentFileList", files); foreach(QWidget * widget, QApplication::topLevelWidgets()) { MainWindow* mainWin = qobject_cast<MainWindow*>(widget); if (mainWin) mainWin->updateRecentFileActions(); }
ChatWidget * SingleWindow::addChat(Chat chat, OpenChatActivation activation) { Q_UNUSED(activation); if (!chat) return nullptr; auto chatWidget = m_pluginInjectedFactory->makeInjected<ChatWidgetImpl>(chat, m_tabs); m_title->addChatWidget(chatWidget); setConfiguration(chatWidget); m_tabs->addTab(chatWidget, chatWidget->title()->blinkingIcon(), QString()); updateTabTitle(chatWidget); connect(chatWidget->edit(), SIGNAL(keyPressed(QKeyEvent *, CustomInput *, bool &)), this, SLOT(onChatKeyPressed(QKeyEvent *, CustomInput *, bool &))); connect(chatWidget->title(), SIGNAL(titleChanged(ChatWidget*)), this, SLOT(onTitleChanged(ChatWidget*))); connect(chatWidget, SIGNAL(closeRequested(ChatWidget*)), this, SLOT(closeTab(ChatWidget*))); return chatWidget; }
void MainWindow::addChild(const QString &imageFileName) { if (!imageFileName.isEmpty()) { QString canonicalImageFileName = QFileInfo(imageFileName).canonicalFilePath(); for (int i = 0; i < tabWidget->count(); ++i) { ChildWidget *child = qobject_cast<ChildWidget *> (tabWidget->widget(i)); if (canonicalImageFileName == child->canonicalImageFileName()) { tabWidget->setCurrentIndex(i); return; } } ChildWidget *child = new ChildWidget; if (child->loadImage(imageFileName)) { statusBar()->showMessage(tr("File loaded"), 2000); tabWidget->setCurrentIndex(tabWidget->addTab(child, child->userFriendlyCurrentFile())); connect(child, SIGNAL(boxChanged()), this, SLOT(updateCommandActions())); connect(child, SIGNAL(modifiedChanged()), this, SLOT(updateTabTitle())); connect(child, SIGNAL(modifiedChanged()), this, SLOT(updateSaveAction())); } else { child->close(); } } }
//----------------------------------------------------------------------------- // Function: TabDocument::setDocumentName() //----------------------------------------------------------------------------- void TabDocument::setDocumentName(QString const& name) { docName_ = name; updateTabTitle(); }