"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/configmanager.cpp" between
texstudio-3.1.0.tar.gz and texstudio-3.1.1.tar.gz

About: TeXstudio is an integrated environment for writing LaTeX documents (as easy and comfortable as possible).

configmanager.cpp  (texstudio-3.1.0):configmanager.cpp  (texstudio-3.1.1)
skipping to change at line 1537 skipping to change at line 1537
} }
connect(confDlg->ui.checkBoxShowAllMenus, SIGNAL(toggled(bool)), SLOT(tog gleVisibleTreeItems(bool))); connect(confDlg->ui.checkBoxShowAllMenus, SIGNAL(toggled(bool)), SLOT(tog gleVisibleTreeItems(bool)));
toggleVisibleTreeItems(false); toggleVisibleTreeItems(false);
connect(confDlg->ui.menuTree, SIGNAL(itemChanged(QTreeWidgetItem *, int)) , this, SLOT(menuTreeItemChanged(QTreeWidgetItem *, int))); connect(confDlg->ui.menuTree, SIGNAL(itemChanged(QTreeWidgetItem *, int)) , this, SLOT(menuTreeItemChanged(QTreeWidgetItem *, int)));
QAction *act = new QAction(tr("Insert New Menu Item (before)"), confDlg-> ui.menuTree); QAction *act = new QAction(tr("Insert New Menu Item (before)"), confDlg-> ui.menuTree);
connect(act, SIGNAL(triggered()), SLOT(menuTreeNewItem())); connect(act, SIGNAL(triggered()), SLOT(menuTreeNewItem()));
confDlg->ui.menuTree->addAction(act); confDlg->ui.menuTree->addAction(act);
act = new QAction(tr("Insert New Sub Menu (before)"), confDlg->ui.menuTre e); act = new QAction(tr("Insert New Sub Menu (before)"), confDlg->ui.menuTre e);
connect(act, SIGNAL(triggered()), SLOT(menuTreeNewMenuItem())); connect(act, SIGNAL(triggered()), SLOT(menuTreeNewMenuItem()));
confDlg->ui.menuTree->addAction(act); confDlg->ui.menuTree->addAction(act);
act = new QAction(tr("Revert/Remove User Menu Item"), confDlg->ui.menuTree);
connect(act, SIGNAL(triggered()), SLOT(menuTreeRevertItem()));
confDlg->ui.menuTree->addAction(act);
confDlg->ui.menuTree->setContextMenuPolicy(Qt::ActionsContextMenu); confDlg->ui.menuTree->setContextMenuPolicy(Qt::ActionsContextMenu);
ComboBoxDelegate *cbd = new ComboBoxDelegate(confDlg->ui.menuTree); ComboBoxDelegate *cbd = new ComboBoxDelegate(confDlg->ui.menuTree);
cbd->defaultItems = possibleMenuSlots; cbd->defaultItems = possibleMenuSlots;
confDlg->ui.menuTree->setItemDelegate(cbd); confDlg->ui.menuTree->setItemDelegate(cbd);
// custom toolbars // custom toolbars
confDlg->customizableToolbars.clear(); confDlg->customizableToolbars.clear();
foreach (const ManagedToolBar &mtb, managedToolBars) { foreach (const ManagedToolBar &mtb, managedToolBars) {
Q_ASSERT(mtb.toolbar); Q_ASSERT(mtb.toolbar);
skipping to change at line 3338 skipping to change at line 3341
filler->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); filler->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
filler->setData(0, Qt::UserRole, newId + "!!end"); filler->setData(0, Qt::UserRole, newId + "!!end");
} }
} }
void ConfigManager::menuTreeNewMenuItem() void ConfigManager::menuTreeNewMenuItem()
{ {
menuTreeNewItem(true); menuTreeNewItem(true);
} }
void ConfigManager::menuTreeRevertItem(){
QAction *a = qobject_cast<QAction *>(sender());
REQUIRE(a);
QTreeWidget *tw = qobject_cast<QTreeWidget *>(a->parentWidget());
REQUIRE(tw);
QTreeWidgetItem *item = tw->currentItem();
REQUIRE(item);
if (!item->parent()) return;
QString ID = item->data(0, Qt::UserRole).toString();
qDebug()<<item->text(0)<<ID;
if(ID.contains("UII")){
//user defined menu/item
QTreeWidgetItem *parent=item->parent();
parent->removeChild(item);
manipulatedMenuTree.remove(ID);
}else{ //revert
QFont bold = item->font(0);
if(bold.bold()){
// was manipulated
item->setText(1,tr("text is restored after restart"));
bold.setBold(false);
bold.setItalic(true);
for (int i = 0; i < 3; i++) item->setFont(i, bold);
manipulatedMenus.remove(ID);
changedItemsList.removeOne(item);
}
}
}
void ConfigManager::toggleVisibleTreeItems(bool show) void ConfigManager::toggleVisibleTreeItems(bool show)
{ {
REQUIRE(!superAdvancedItems.isEmpty()); REQUIRE(!superAdvancedItems.isEmpty());
foreach (QTreeWidgetItem *twi, superAdvancedItems) foreach (QTreeWidgetItem *twi, superAdvancedItems)
twi->setHidden(!show); twi->setHidden(!show);
QTreeWidget *tw = superAdvancedItems.first()->treeWidget(); QTreeWidget *tw = superAdvancedItems.first()->treeWidget();
tw->setColumnHidden(2, !show); tw->setColumnHidden(2, !show);
if (show && tw->columnWidth(0) + tw->columnWidth(1) + tw->columnWidth(2) > tw->width() + 50) if (show && tw->columnWidth(0) + tw->columnWidth(1) + tw->columnWidth(2) > tw->width() + 50)
tw->setColumnWidth(1, tw->width() - tw->columnWidth(0) - tw->colu mnWidth(2)); tw->setColumnWidth(1, tw->width() - tw->columnWidth(0) - tw->colu mnWidth(2));
} }
void ConfigManager::treeWidgetToManagedLatexMenuTo() void ConfigManager::treeWidgetToManagedLatexMenuTo()
{ {
manipulatedMenus.clear();
foreach (QTreeWidgetItem *item, changedItemsList) { foreach (QTreeWidgetItem *item, changedItemsList) {
QString id = item->data(0, Qt::UserRole).toString(); QString id = item->data(0, Qt::UserRole).toString();
if (id == "") continue; if (id == "") continue;
QStringList m; QStringList m;
m << item->text(0) m << item->text(0)
<< item->text(1) << item->text(1)
<< (item->checkState(0) == Qt::Checked ? "visible" : "hidden") << (item->checkState(0) == Qt::Checked ? "visible" : "hidden")
<< item->data(0, Qt::UserRole + 1).toString() << item->data(0, Qt::UserRole + 1).toString()
<< ((item->text(2) != item->data(2, Qt::UserRole).toString()) ? item->text(2) : ""); << ((item->text(2) != item->data(2, Qt::UserRole).toString()) ? item->text(2) : "");
manipulatedMenus.insert(id, m); manipulatedMenus.insert(id, m);
 End of changes. 3 change blocks. 
0 lines changed or deleted 34 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)