Ignore:
Timestamp:
04/24/13 08:06:56 (17 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.1-release, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
47239e7
Parents:
f424798
git-author:
Ken Moore <ken@…> (04/24/13 08:04:57)
git-committer:
Ken Moore <ken@…> (04/24/13 08:06:56)
Message:

Update EasyPBI to version 2.1
Changes: FreeBSD ports dialog merged into the settings dialog, save buttons now dynamicly enabled, use portsnap for all ports fetching/updating

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/EasyPBI/mainGUI.cpp

    r56d14dd re177abf  
    66#include "preferencesDialog.h" 
    77#include "aboutDialog.h" 
    8 #include "portsDialog.h" 
    98 
    109MainGUI::MainGUI(QWidget *parent) : 
     
    9291      refreshGUI("all"); //make items visible/invisible as necessary 
    9392       
     93      //Connect "option changed" signals to the respective slot 
     94      // PBI tab 
     95      connect(ui->line_progname,SIGNAL(textChanged(QString)),this,SLOT(slotOptionChanged(QString)) ); 
     96      connect(ui->line_progauthor,SIGNAL(textChanged(QString)),this,SLOT(slotOptionChanged(QString)) ); 
     97      connect(ui->line_progversion,SIGNAL(textChanged(QString)),this,SLOT(slotOptionChanged(QString)) ); 
     98      connect(ui->line_progweb,SIGNAL(textChanged(QString)),this,SLOT(slotOptionChanged(QString)) ); 
     99      connect(ui->line_progdir,SIGNAL(textChanged(QString)),this,SLOT(slotOptionChanged(QString)) ); 
     100      connect(ui->line_makeport,SIGNAL(textChanged(QString)),this,SLOT(slotOptionChanged(QString)) ); 
     101      connect(ui->list_progicon,SIGNAL(currentIndexChanged(QString)),this,SLOT(slotOptionChanged(QString)) ); 
     102      connect(ui->edit_makeopts,SIGNAL(textChanged()),this,SLOT(slotOptionChanged()) ); 
     103      connect(ui->check_requiresroot, SIGNAL(clicked()),this,SLOT(slotOptionChanged()) ); 
     104      // Rwsources tab 
     105      connect(ui->text_resources_script,SIGNAL(textChanged()),this,SLOT(slotResourceScriptChanged()) ); 
     106      // XDG tab 
     107      connect(ui->line_xdg_name,SIGNAL(textChanged(QString)),this,SLOT(slotXDGOptionChanged(QString)) ); 
     108      connect(ui->line_xdg_mimepatterns,SIGNAL(textChanged(QString)),this,SLOT(slotXDGOptionChanged(QString)) ); 
     109      connect(ui->line_xdg_exec,SIGNAL(textChanged(QString)),this,SLOT(slotXDGOptionChanged(QString)) ); 
     110      connect(ui->line_xdg_menu,SIGNAL(textChanged(QString)),this,SLOT(slotXDGOptionChanged(QString)) ); 
     111      connect(ui->check_xdg_nodisplay,SIGNAL(clicked()),this,SLOT(slotXDGOptionChanged()) ); 
     112      connect(ui->check_xdg_requiresroot,SIGNAL(clicked()),this,SLOT(slotXDGOptionChanged()) ); 
     113      connect(ui->check_xdg_terminal,SIGNAL(clicked()),this,SLOT(slotXDGOptionChanged()) ); 
     114      connect(ui->list_xdg_icon,SIGNAL(currentIndexChanged(QString)),this,SLOT(slotXDGOptionChanged(QString)) ); 
     115      // Scripts tab 
     116      connect(ui->text_scripts_edit,SIGNAL(textChanged()),this,SLOT(slotScriptModified()) ); 
     117         
    94118} 
    95119 
     
    227251      } 
    228252    } 
     253    ui->push_config_save->setEnabled(FALSE);  //disable the save button until something changes 
    229254  } 
    230255  // -----RESOURCES-------- 
     
    278303    } 
    279304    if(currentIndex == 0){ ui->push_scripts_create->setVisible(FALSE); } 
     305    ui->push_scripts_save->setEnabled(FALSE); //disable the save button until something changes 
    280306     
    281307  } 
     
    346372  ----------------------------------- 
    347373*/ 
    348 void MainGUI::on_actionGet_Ports_triggered(){ 
    349   portsDialog dlg(this,settings->value("progdir")+"/ports",settings->value("su_cmd") ); 
    350   dlg.exec(); 
    351 } 
    352374 
    353375void MainGUI::on_actionExit_triggered(){ 
     
    528550  //Save the port info to the GUI 
    529551  ui->line_makeport->setText(portSel.remove(settings->value("portsdir")+"/")); 
     552  ui->push_config_save->setEnabled(TRUE); 
    530553} 
    531554 
     
    536559  //Save the port info to the GUI 
    537560  ui->line_progdir->setText(dirSel); 
     561  ui->push_config_save->setEnabled(TRUE); 
    538562} 
    539563 
     
    586610  //Now put the new options list back onto the GUI 
    587611  ui->edit_makeopts->setPlainText(curr.join("\n")); 
     612  ui->push_config_save->setEnabled(TRUE); 
    588613} 
    589614 
     
    604629  if(ui->list_portbefore->count() == 1 && ui->list_portbefore->currentText().isEmpty() ){ ui->list_portbefore->clear(); } 
    605630  ui->list_portbefore->addItem(portSel.remove(settings->value("portsdir")+"/")); 
     631  ui->push_config_save->setEnabled(TRUE); 
    606632} 
    607633 
     
    611637    ui->list_portbefore->removeItem(index); 
    612638  } 
     639  ui->push_config_save->setEnabled(TRUE); 
    613640} 
    614641 
     
    629656  if(ui->list_portafter->count() == 1 && ui->list_portafter->currentText().isEmpty() ){ ui->list_portafter->clear(); } 
    630657  ui->list_portafter->addItem(portSel.remove(settings->value("portsdir")+"/")); 
     658  ui->push_config_save->setEnabled(TRUE); 
    631659} 
    632660 
     
    636664    ui->list_portafter->removeItem(index); 
    637665  } 
     666  ui->push_config_save->setEnabled(TRUE); 
    638667} 
    639668 
     
    680709  } 
    681710} 
     711 
     712void MainGUI::slotOptionChanged(QString tmp){ 
     713  tmp.clear(); //just to remove compiler warning about unused variable 
     714  ui->push_config_save->setEnabled(TRUE);        
     715} 
     716 
    682717/*------------------------------------------------ 
    683718   RESOURCE EDITOR OPTIONS 
     
    717752      ui->label_resources_icon->setVisible(FALSE); 
    718753    } 
    719   }        
     754  } 
     755  ui->push_resources_savewrapper->setEnabled(FALSE); 
    720756   
    721757} 
     
    772808  //overwrite the resource with the new contents 
    773809  ModBuild::createFile(filePath,contents); 
     810  ui->push_resources_savewrapper->setEnabled(FALSE); 
     811} 
     812 
     813void MainGUI::slotResourceScriptChanged(){ 
     814  ui->push_resources_savewrapper->setEnabled(TRUE);      
    774815} 
    775816/*------------------------------------------------ 
     
    862903    ui->check_requiresroot->setChecked(FALSE); 
    863904    ui->push_xdg_savechanges->setEnabled(FALSE); 
     905    ui->push_xdg_savenew->setEnabled(FALSE); 
    864906    //Make sure we don't have any of the structures loaded from previously 
    865907    currentModule->loadDesktop(""); 
     
    869911    return;  
    870912  } 
    871   ui->push_xdg_savechanges->setEnabled(TRUE); 
    872913  //Now setup the UI as appropriate 
    873914  if(ui->radio_xdg_desktop->isChecked()){ 
     
    945986    //do nothing, unknown radio button selected (or none) 
    946987  } 
     988  ui->push_xdg_savechanges->setEnabled(FALSE); 
     989  ui->push_xdg_savenew->setEnabled(FALSE); 
    947990} 
    948991 
     
    11521195} 
    11531196 
     1197void MainGUI::slotXDGOptionChanged(QString tmp){ 
     1198  tmp.clear(); //remove warning about unused variables 
     1199  ui->push_xdg_savechanges->setEnabled(TRUE); 
     1200  ui->push_xdg_savenew->setEnabled(TRUE); 
     1201} 
     1202 
    11541203/*------------------------------------------------ 
    11551204   SCRIPTS EDITOR OPTIONS 
     
    11681217  ui->text_scripts_edit->setVisible(TRUE); 
    11691218  ui->text_scripts_edit->clear(); 
     1219  ui->push_scripts_save->setEnabled(FALSE); //disable the save button until something changes 
    11701220} 
    11711221 
     
    11931243  //Now refresh the UI 
    11941244  refreshGUI("scripts"); 
     1245} 
     1246 
     1247void MainGUI::slotScriptModified(){ 
     1248  ui->push_scripts_save->setEnabled(TRUE);       
    11951249} 
    11961250/*------------------------------------------------ 
Note: See TracChangeset for help on using the changeset viewer.