void PanelWidget::on_tool_upplugin_clicked(){ int row = ui->list_plugins->currentRow(); if( row <= 0){ return; } ui->list_plugins->insertItem(row-1, ui->list_plugins->takeItem(row)); ui->list_plugins->setCurrentRow(row-1); emit PanelChanged(); }
void PanelWidget::on_tool_downplugin_clicked(){ int row = ui->list_plugins->currentRow(); if( row < 0 || row >= (ui->list_plugins->count()-1) ){ return; } ui->list_plugins->insertItem(row+1, ui->list_plugins->takeItem(row)); ui->list_plugins->setCurrentRow(row+1); emit PanelChanged(); }
void PanelWidget::on_tool_addplugin_clicked(){ GetPluginDialog dlg(mainui); dlg.LoadPlugins("panel", PINFO); dlg.exec(); if(!dlg.selected){ return; } //cancelled QString pan = dlg.plugID; //getNewPanelPlugin(); if(pan == "applauncher"){ //Prompt for the application to add XDGDesktop app = static_cast<MainUI*>(mainui)->getSysApp(); if(app.filePath.isEmpty()){ return; } //cancelled pan.append("::"+app.filePath); QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(app.icon,""), app.name); it->setWhatsThis(pan); ui->list_plugins->addItem(it); ui->list_plugins->setCurrentItem(it); ui->list_plugins->scrollToItem(it); }else{ if(pan.isEmpty()){ return; } //nothing selected //Add the new plugin to the list LPI info = PINFO->panelPluginInfo(pan); QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name); it->setWhatsThis(info.ID); ui->list_plugins->addItem(it); ui->list_plugins->setCurrentItem(it); ui->list_plugins->scrollToItem(it); } emit PanelChanged(); }
void TransfersPanel::OnNewTransfersDone() { if (IsFocused(TRUE)) g_desktop_transfer_manager->SetNewTransfersDone(FALSE); PanelChanged(); }
void PanelWidget::on_tool_selectcolor_clicked(){ QString color = static_cast<MainUI*>(mainui)->getColorStyle(ui->label_color_sample->whatsThis()); if( color.isEmpty()){ return; } ui->label_color_sample->setWhatsThis(color); reloadColorSample(); emit PanelChanged(); }
void TransfersPanel::OnTransferAdded(TransferItemContainer* transferItem) { PanelChanged(); if (m_transfers_view->IsFocused()) return; TransferItemContainer* item = (TransferItemContainer*)m_transfers_view->GetSelectedItem(); if (item && item->GetStatus() == OpTransferListener::TRANSFER_PROGRESS) { return; } m_transfers_view->SetSelectedItem(m_transfers_view->GetItemByModelItem(transferItem)); }
void page_interface_panels::newPanel() { if(panelnumber<0) { panelnumber=0; //just in case } panelnumber++; //Now create a new Panel widget with this number PanelWidget *tmp = new PanelWidget(ui->scroll_panels->widget(), this, PINFO); tmp->LoadSettings(settings, cscreen, panelnumber-1); PANELS << tmp; connect(tmp, SIGNAL(PanelChanged()), this, SLOT(panelValChanged()) ); connect(tmp, SIGNAL(PanelRemoved(int)), this, SLOT(removePanel(int)) ); static_cast<QBoxLayout*>(ui->scroll_panels->widget()->layout())->insertWidget(PANELS.length()-1, tmp); //update the widget first (2 necessary for scroll below to work) ui->scroll_panels->update(); QApplication::processEvents(); QApplication::processEvents(); ui->scroll_panels->ensureWidgetVisible(tmp); panelValChanged(); }
void TransfersPanel::OnTransferProgress(TransferItemContainer* transferItem, OpTransferListener::TransferStatus status) { PanelChanged(); TransferItemContainer* item = (TransferItemContainer*)m_transfers_view->GetSelectedItem(); if(!item) { m_item_details_from_info_label->SetText(UNI_L("")); m_item_details_to_info_label->SetText(UNI_L("")); m_item_details_size_info_label->SetText(UNI_L("")); m_item_details_transferred_info_label->SetText(UNI_L("")); m_item_details_connections_info_label->SetText(UNI_L("")); m_item_details_activetransfers_info_label->SetText(UNI_L("")); return; } if(item == transferItem) UpdateDetails(transferItem->GetAssociatedItem(), TRUE); }
void page_interface_panels::LoadSettings(int screennum) { if(screennum>=0) { cscreen = screennum; } loading = true; emit HasPendingChanges(false); emit ChangePageTitle( tr("Desktop Settings") ); QString DPrefix = "desktop-"+QString::number(cscreen)+"/"; int panelnumber = settings->value(DPrefix+"panels",-1).toInt(); //First clean any current panels for(int i=0; i<PANELS.length(); i++) { delete PANELS.takeAt(i); i--; } //Now create new panels if(ui->scroll_panels->widget()->layout()==0) { ui->scroll_panels->widget()->setLayout( new QHBoxLayout() ); ui->scroll_panels->widget()->layout()->setContentsMargins(0,0,0,0); } ui->scroll_panels->widget()->layout()->setAlignment(Qt::AlignLeft); //Clear anything left over in the layout for(int i=0; i<ui->scroll_panels->widget()->layout()->count(); i++) { delete ui->scroll_panels->widget()->layout()->takeAt(i); } for(int i=0; i<panelnumber; i++) { PanelWidget *tmp = new PanelWidget(ui->scroll_panels->widget(), this, PINFO); tmp->LoadSettings(settings, cscreen, i); PANELS << tmp; connect(tmp, SIGNAL(PanelChanged()), this, SLOT(panelValChanged()) ); connect(tmp, SIGNAL(PanelRemoved(int)), this, SLOT(removePanel(int)) ); ui->scroll_panels->widget()->layout()->addWidget(tmp); } static_cast<QHBoxLayout*>(ui->scroll_panels->widget()->layout())->addStretch(); QApplication::processEvents(); loading = false; }
void PanelWidget::on_tool_remplugin_clicked(){ if(ui->list_plugins->currentRow() < 0){ return; } delete ui->list_plugins->takeItem( ui->list_plugins->currentRow() ); emit PanelChanged(); }
void PanelWidget::UseColorChanged(){ emit PanelChanged(); }
void PanelWidget::ItemChanged(){ emit PanelChanged(); }
void TransfersPanel::OnTransferRemoved(TransferItemContainer* transferItem) { PanelChanged(); }