traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src/traverso/widgets ResourcesWidget.cpp


From: Ben Levitt
Subject: [Traverso-commit] traverso/src/traverso/widgets ResourcesWidget.cpp
Date: Mon, 04 Jun 2007 05:29:19 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Ben Levitt <benjie>     07/06/04 05:29:19

Modified files:
        src/traverso/widgets: ResourcesWidget.cpp 

Log message:
        Add a Refresh Button to the FileWidget (needs a better icon.  Doesn't 
QT have a standard refresh/reload icon??)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/widgets/ResourcesWidget.cpp?cvsroot=traverso&r1=1.22&r2=1.23

Patches:
Index: ResourcesWidget.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/widgets/ResourcesWidget.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- ResourcesWidget.cpp 24 May 2007 17:45:20 -0000      1.22
+++ ResourcesWidget.cpp 4 Jun 2007 05:29:19 -0000       1.23
@@ -70,13 +70,23 @@
                m_box->addItem(QDir::rootPath(), QDir::rootPath());
                m_box->addItem(QDir::homePath(), QDir::homePath());
 #endif
-               QPushButton* button = new QPushButton(this);
-               QIcon icon = 
QApplication::style()->standardIcon(QStyle::SP_FileDialogToParent);
-               button->setIcon(icon);
-               button->setMaximumHeight(23);
+               QPushButton* upButton = new QPushButton(this);
+               QIcon upIcon = 
QApplication::style()->standardIcon(QStyle::SP_FileDialogToParent);
+               upButton->setToolTip(tr("Parent Directory"));
+               upButton->setIcon(upIcon);
+               upButton->setMaximumHeight(25);
+               upButton->setMaximumWidth(30);
+               
+               QPushButton* refreshButton = new QPushButton(this);
+               QIcon refreshIcon = 
QApplication::style()->standardIcon(QStyle::SP_FileDialogNewFolder); // FIXME:  
needs a better icon!
+               refreshButton->setToolTip(tr("Refresh File View"));
+               refreshButton->setIcon(refreshIcon);
+               refreshButton->setMaximumHeight(25);
+               refreshButton->setMaximumWidth(30);
                
                QHBoxLayout* hlay = new QHBoxLayout;
-               hlay->addWidget(button);
+               hlay->addWidget(upButton);
+               hlay->addWidget(refreshButton);
                hlay->addWidget(m_box, 10);
                
                QVBoxLayout* lay = new QVBoxLayout(this);
@@ -88,7 +98,8 @@
                setLayout(lay);
                
                connect(m_dirView, SIGNAL(clicked(const QModelIndex& )), this, 
SLOT(dirview_item_clicked(const QModelIndex&)));
-               connect(button, SIGNAL(clicked()), this, 
SLOT(dir_up_button_clicked()));
+               connect(upButton, SIGNAL(clicked()), this, 
SLOT(dir_up_button_clicked()));
+               connect(refreshButton, SIGNAL(clicked()), this, 
SLOT(refresh_button_clicked()));
                connect(m_box, SIGNAL(activated(int)), this, 
SLOT(box_actived(int)));
                
        }
@@ -98,6 +109,7 @@
 private slots:
        void dirview_item_clicked(const QModelIndex & index);
        void dir_up_button_clicked();
+       void refresh_button_clicked();
        void box_actived(int i);
        
 private:
@@ -146,6 +158,11 @@
        m_box->setCurrentIndex(0);
 }
 
+void FileWidget::refresh_button_clicked()
+{
+       m_dirModel->refresh(m_dirView->rootIndex());
+}
+
 void FileWidget::box_actived(int i)
 {
        
m_dirView->setRootIndex(m_dirModel->index(m_box->itemData(i).toString()));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]