Changeset 84406a4
- Timestamp:
- Apr 24, 2013 4:21:11 PM (4 weeks ago)
- Branches:
- master, 9.1-release
- Children:
- b4350b9
- Parents:
- d5d5aa1
- Location:
- src-qt4/pc-pkgmanager
- Files:
-
- 3 edited
-
mainWin.cpp (modified) (5 diffs)
-
mainWin.h (modified) (3 diffs)
-
mainWin.ui (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src-qt4/pc-pkgmanager/mainWin.cpp
r98b904e r84406a4 21 21 #include <pcbsd-utils.h> 22 22 #include <pcbsd-ui.h> 23 #include <QSettings> 23 24 #include "mainWin.h" 24 25 #include "../config.h" … … 36 37 connect(buttonRescanPkgs, SIGNAL(clicked()), this, SLOT(slotRescanPkgsClicked())); 37 38 connect(pushPkgApply, SIGNAL( clicked() ), this, SLOT( slotApplyClicked() ) ); 39 connect(action_Quit, SIGNAL( triggered(bool) ), this, SLOT( slotCloseClicked() ) ); 40 connect(action_Basic, SIGNAL( triggered(bool) ), this, SLOT( slotViewChanged() ) ); 41 connect(action_Advanced, SIGNAL( triggered(bool) ), this, SLOT( slotViewChanged() ) ); 42 43 // Setup the action group 44 viewGroup = new QActionGroup(this); 45 viewGroup->addAction(action_Basic); 46 viewGroup->addAction(action_Advanced); 47 48 treeMetaPkgs->setContextMenuPolicy(Qt::CustomContextMenu); 49 connect(treeMetaPkgs, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(slotMetaRightClick()) ); 38 50 39 51 QTimer::singleShot(200, this, SLOT(slotRescanPkgsClicked() ) ); 52 53 QSettings settings("PC-BSD", "PackageManager"); 54 QString curMode = settings.value("view/mode").toString(); 55 if ( curMode == "Advanced" ) 56 { 57 stackedPkgView->setCurrentIndex(1); 58 action_Basic->setChecked(false); 59 action_Advanced->setChecked(true); 60 } 61 62 initMetaWidget(); 63 } 64 65 void mainWin::slotViewChanged() 66 { 67 QString mode; 68 if ( action_Basic->isChecked() ) { 69 stackedPkgView->setCurrentIndex(0); 70 mode="Basic"; 71 } else { 72 mode="Advanced"; 73 stackedPkgView->setCurrentIndex(1); 74 } 75 76 // Save the mode as the default at next open 77 QSettings settings("PC-BSD", "PackageManager"); 78 settings.setValue("view/mode", mode); 79 80 // Changed view, lets refresh 40 81 initMetaWidget(); 41 82 } … … 48 89 49 90 void mainWin::slotApplyClicked() { 91 // Running in basic mode 92 if ( stackedPkgView->currentIndex() == 0 ) 93 { 94 saveMetaPkgs(); 95 } else { 96 // Running in advanced mode 97 98 } 50 99 51 100 } … … 339 388 QMessageBox::warning(this, tr("Finished!"), tr("Package changes complete!" )); 340 389 390 // Clear out the old commands 391 pkgCmdList.clear(); 392 393 // Switch back to our main display 341 394 stackedTop->setCurrentIndex(0); 395 396 // Re-init the meta-widget 397 initMetaWidget(); 342 398 343 399 } … … 351 407 qDebug() << "Starting metaWidget..."; 352 408 353 populateMetaPkgs(); 354 355 // Connect our slots 356 treeMetaPkgs->setContextMenuPolicy(Qt::CustomContextMenu); 357 connect(treeMetaPkgs, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(slotMetaRightClick()) ); 409 // Running in basic mode 410 if ( stackedPkgView->currentIndex() == 0 ) 411 { 412 populateMetaPkgs(); 413 // Connect our slots 414 } else { 415 // Running in advanced mode 416 417 } 418 358 419 359 420 -
src-qt4/pc-pkgmanager/mainWin.h
r98b904e r84406a4 39 39 40 40 private slots: 41 void slotCloseClicked();42 41 43 42 // Generic pkgng handlers … … 57 56 void slotMetaRightClick(); 58 57 void slotMetaViewPkgs(); 58 59 // UI Stuff 60 void slotViewChanged(); 61 void slotCloseClicked(); 59 62 60 63 private: … … 113 116 QMenu *popup; 114 117 dialogInfo *dIB; 118 QActionGroup *viewGroup; 115 119 116 120 signals: -
src-qt4/pc-pkgmanager/mainWin.ui
r98b904e r84406a4 67 67 </item> 68 68 <item row="0" column="0"> 69 <widget class="QStackedWidget" name="stackedPkg Mode">69 <widget class="QStackedWidget" name="stackedPkgView"> 70 70 <property name="currentIndex"> 71 71 <number>0</number>
Note: See TracChangeset
for help on using the changeset viewer.
