Skip to content
Browse files

Merge branch 'master' of github.com:pcbsd/pcbsd

  • Loading branch information...
2 parents 7a8333b + 9a7d00b commit f951af72fe48c413b25a0e15dd320a93919c499a @kmoore134 kmoore134 committed Jun 21, 2013
Showing with 130 additions and 71 deletions.
  1. +37 −21 src-qt4/pc-softwaremanager/mainUI.cpp
  2. +93 −50 src-qt4/pc-softwaremanager/mainUI.ui
View
58 src-qt4/pc-softwaremanager/mainUI.cpp
@@ -187,7 +187,6 @@ QStringList MainUI::getCheckedItems(){
for(int i=0; i<ui->tree_install_apps->topLevelItemCount(); i++){
if(ui->tree_install_apps->topLevelItem(i)->checkState(0) == Qt::Checked){
output << ui->tree_install_apps->topLevelItem(i)->whatsThis(0);
- //ui->tree_install_apps->topLevelItem(i)->setCheckState(0,Qt::Unchecked);
}
}
return output;
@@ -196,35 +195,52 @@ QStringList MainUI::getCheckedItems(){
// === SLOTS ===
void MainUI::slotRefreshInstallTab(){
//Update the list of installed PBI's w/o clearing the list (loses selections)
+ //Get the list we need (in order)
QStringList installList = PBI->installedList();
- //Update the currently shown list
+ installList.sort(); //sort in ascending order
+ //Get the list we have now
+ QStringList cList;
for(int i=0; i<ui->tree_install_apps->topLevelItemCount(); i++){
- QString itemID = ui->tree_install_apps->topLevelItem(i)->whatsThis(0);
- int index = installList.indexOf(itemID);
- if( index != -1 ){ //item is still installed
- //Update the widget item
+ cList << ui->tree_install_apps->topLevelItem(i)->whatsThis(0);
+ }
+ //Now make adjustments as necessary
+ for(int i=0; i<installList.length(); i++){
+ //Detemine what action should be done with this item location
+ int todo = 0; //0=insert new item, 1=update current item, 2=remove current item
+ if(i < cList.length()){
+ if(installList[i] == cList[i]){ todo=1; }
+ else if( installList.contains(cList[i]) && !cList.contains(installList[i]) ){ todo=0; } //new item to be inserted here
+ else if( !installList.contains(cList[i]) ){ todo=2; } //current item in this location should be removed
+ }
+ //Now perform the action on this location
+ if(todo==0){
+ //insert new item
+ QTreeWidgetItem *item = new QTreeWidgetItem; //create the item
+ item->setWhatsThis(0,installList[i]);
+ //Now format the display
+ formatInstalledItemDisplay(item);
+ //Now insert this item onto the list
+ ui->tree_install_apps->insertTopLevelItem(i,item);
+ cList.insert(i,installList[i]); //reflect this inclusion into the current list
+ }else if(todo==1){
+ //Update current item
formatInstalledItemDisplay( ui->tree_install_apps->topLevelItem(i) );
- //Now remove the item from the installed list - already done with it
- installList.removeAt(index);
}else{
- //Remove the item from the UI list - no longer installed
+ //Remove current item
ui->tree_install_apps->takeTopLevelItem(i);
- i--; //Make sure we don't miss an item by changing the count
+ cList.removeAt(i); //reflect the change to the current list
+ i--; //Re-check the item that should be in this location
}
}
- //Now Create new widget items as necessary (anything left on the installed list)
- for(int i=0; i<installList.length();i++){
- QTreeWidgetItem *item = new QTreeWidgetItem; //create the item
- item->setWhatsThis(0,installList[i]);
- //Now format the display
- formatInstalledItemDisplay(item);
- //Now add this item to the list
- ui->tree_install_apps->addTopLevelItem(item);
+ //Now makesure that there are no extra items at the end
+ int il = installList.length();
+ while(il < cList.length()){
+ ui->tree_install_apps->takeTopLevelItem(il);
+ cList.removeAt(il); //reflect the change to the current list
}
- //Now re-sort the items
+
+ //Make sure that there is an item selected
if(ui->tree_install_apps->topLevelItemCount() > 0 ){
- ui->tree_install_apps->sortItems(0,Qt::AscendingOrder);
- //Make sure that there is an item selected
if( ui->tree_install_apps->selectedItems().isEmpty() ){
ui->tree_install_apps->setCurrentItem( ui->tree_install_apps->topLevelItem(0) );
}
View
143 src-qt4/pc-softwaremanager/mainUI.ui
@@ -25,7 +25,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
- <number>0</number>
+ <number>1</number>
</property>
<property name="iconSize">
<size>
@@ -167,10 +167,10 @@
</property>
<property name="styleSheet">
<string notr="true">QGroupBox::indicator:unchecked{
-image: url(:icons/arrow-up.png);
+image: url(:icons/arrow-down.png);
}
QGroupBox::indicator:checked{
-image: url(:icons/arrow-down.png);
+image: url(:icons/arrow-up.png);
}
QGroupBox::title{
spacing: 1px;
@@ -364,6 +364,13 @@ border-radius: 5px;
</layout>
</item>
<item>
+ <widget class="Line" name="line_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -540,17 +547,30 @@ QGroupBox{
font-weight: bold;
}
QToolButton{
- background-color: rgba(190,190,190,80);
+ background-color: rgba(145,142,140,80);
+ border: 1px solid grey;
+ border-radius: 5px;
+}
+QToolButton:hover{
+ background-color: rgba(145,142,140,80);
+ border: 1px solid rgba(140,140,250,230);
+ border-radius: 5px;
}
QTextEdit{
background-color: rgba(190,190,190,30);
+border: 1px solid grey;
+border-radius: 5px;
}
QScrollBar{
background-color: rgba(190,190,190,80);
border: 2px solid rgba(190,190,190,200);
border-radius: 5px;
}
-</string>
+QScrollArea{
+ background-color: rgba(190,190,190,30);
+ border: 1px solid grey;
+ border-radius: 5px;
+}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
@@ -570,10 +590,10 @@ QScrollBar{
</property>
<property name="styleSheet">
<string notr="true">QGroupBox::indicator:unchecked{
-image: url(:icons/arrow-up.png);
+image: url(:icons/arrow-down.png);
}
QGroupBox::indicator:checked{
-image: url(:icons/arrow-down.png);
+image: url(:icons/arrow-up.png);
}
QGroupBox::title{
spacing: 1px;
@@ -623,8 +643,8 @@ spacing: 1px;
<rect>
<x>0</x>
<y>0</y>
- <width>96</width>
- <height>26</height>
+ <width>447</width>
+ <height>61</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5"/>
@@ -674,8 +694,8 @@ spacing: 1px;
<rect>
<x>0</x>
<y>0</y>
- <width>96</width>
- <height>26</height>
+ <width>441</width>
+ <height>283</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6"/>
@@ -699,8 +719,8 @@ spacing: 1px;
<rect>
<x>0</x>
<y>0</y>
- <width>96</width>
- <height>26</height>
+ <width>463</width>
+ <height>410</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_23"/>
@@ -805,36 +825,56 @@ spacing: 1px;
<item>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
- <widget class="QToolButton" name="tool_bapp_download">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string notr="true">Install Now!</string>
- </property>
- <property name="icon">
- <iconset resource="SoftwareManager.qrc">
- <normaloff>:/icons/app_download.png</normaloff>:/icons/app_download.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>48</width>
- <height>48</height>
- </size>
- </property>
- <property name="toolButtonStyle">
- <enum>Qt::ToolButtonTextUnderIcon</enum>
- </property>
- </widget>
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <item>
+ <spacer name="horizontalSpacer_8">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="tool_bapp_download">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string notr="true">Install Now!</string>
+ </property>
+ <property name="icon">
+ <iconset resource="SoftwareManager.qrc">
+ <normaloff>:/icons/app_download.png</normaloff>:/icons/app_download.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>48</width>
+ <height>48</height>
+ </size>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextUnderIcon</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
<item>
<layout class="QFormLayout" name="formLayout_5">
@@ -1047,10 +1087,10 @@ spacing: 1px;
<widget class="QGroupBox" name="group_bapp_similar">
<property name="styleSheet">
<string notr="true">QGroupBox::indicator:unchecked{
-image: url(:icons/arrow-up.png);
+image: url(:icons/arrow-down.png);
}
QGroupBox::indicator:checked{
-image: url(:icons/arrow-down.png);
+image: url(:icons/arrow-up.png);
}
QGroupBox::title{
spacing: 1px;
@@ -1065,6 +1105,9 @@ spacing: 1px;
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QScrollArea" name="scroll_bapp_similar">
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
@@ -1076,7 +1119,7 @@ spacing: 1px;
<rect>
<x>0</x>
<y>0</y>
- <width>445</width>
+ <width>447</width>
<height>61</height>
</rect>
</property>
@@ -1137,8 +1180,8 @@ spacing: 1px;
<rect>
<x>0</x>
<y>0</y>
- <width>96</width>
- <height>26</height>
+ <width>70</width>
+ <height>16</height>
</rect>
</property>
</widget>
@@ -1175,8 +1218,8 @@ spacing: 1px;
<rect>
<x>0</x>
<y>0</y>
- <width>96</width>
- <height>26</height>
+ <width>70</width>
+ <height>16</height>
</rect>
</property>
</widget>

0 comments on commit f951af7

Please sign in to comment.
Something went wrong with that request. Please try again.