don't connect do itemActivated for listDevies, connect to itemDoubleClicked.
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1092961
This commit is contained in:
parent
10c32cdb87
commit
51f3be7690
1
TODO
1
TODO
|
@ -23,3 +23,4 @@ Random plans and ideas for 1.1 and beyond:
|
|||
|
||||
* Check if no of sectors fits in an unsigned 32 bit int for msdos partition tables.
|
||||
|
||||
* Rememver previously selected device after applying and rescanning.
|
||||
|
|
|
@ -95,10 +95,10 @@ void ListDevices::on_m_ListDevices_customContextMenuRequested(const QPoint& pos)
|
|||
deviceMenu.exec(listDevices().viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void ListDevices::on_m_ListDevices_itemActivated(QListWidgetItem* list_item)
|
||||
void ListDevices::on_m_ListDevices_itemDoubleClicked(QListWidgetItem* list_item)
|
||||
{
|
||||
ListDeviceWidgetItem* item = dynamic_cast<ListDeviceWidgetItem*>(list_item);
|
||||
|
||||
if (item != NULL)
|
||||
emit deviceActivated(item->deviceNode);
|
||||
emit deviceDoubleClicked(item->deviceNode);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ class LIBPARTITIONMANAGERPRIVATE_EXPORT ListDevices : public QWidget, public Ui:
|
|||
|
||||
signals:
|
||||
void selectionChanged(const QString& device_node);
|
||||
void deviceActivated(const QString& device_node);
|
||||
void deviceDoubleClicked(const QString& device_node);
|
||||
|
||||
public:
|
||||
void setActionCollection(KActionCollection* coll) { m_ActionCollection = coll; }
|
||||
|
@ -62,7 +62,7 @@ class LIBPARTITIONMANAGERPRIVATE_EXPORT ListDevices : public QWidget, public Ui:
|
|||
protected slots:
|
||||
void on_m_ListDevices_itemSelectionChanged();
|
||||
void on_m_ListDevices_customContextMenuRequested(const QPoint& pos);
|
||||
void on_m_ListDevices_itemActivated(QListWidgetItem* list_item);
|
||||
void on_m_ListDevices_itemDoubleClicked(QListWidgetItem* list_item);
|
||||
|
||||
private:
|
||||
KActionCollection* m_ActionCollection;
|
||||
|
|
|
@ -143,7 +143,7 @@ void MainWindow::setupActions()
|
|||
void MainWindow::setupConnections()
|
||||
{
|
||||
connect(&listDevices(), SIGNAL(selectionChanged(const QString&)), &pmWidget(), SLOT(setSelectedDevice(const QString&)));
|
||||
connect(&listDevices(), SIGNAL(deviceActivated(const QString&)), &pmWidget(), SLOT(onPropertiesDevice(const QString&)));
|
||||
connect(&listDevices(), SIGNAL(deviceDoubleClicked(const QString&)), &pmWidget(), SLOT(onPropertiesDevice(const QString&)));
|
||||
}
|
||||
|
||||
void MainWindow::setupStatusBar()
|
||||
|
|
|
@ -614,9 +614,20 @@ void PartitionManagerWidget::showPartitionContextMenu(const QPoint& pos)
|
|||
{
|
||||
Q_ASSERT(actionCollection());
|
||||
|
||||
if (selectedPartition() == NULL || actionCollection() == NULL)
|
||||
if (actionCollection() == NULL)
|
||||
return;
|
||||
|
||||
if (selectedPartition() == NULL)
|
||||
{
|
||||
if (selectedDevice() != NULL)
|
||||
{
|
||||
// show context menu for device
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
KMenu partitionMenu;
|
||||
|
||||
partitionMenu.addAction(actionCollection()->action("newPartition"));
|
||||
|
|
|
@ -106,7 +106,7 @@ void PartitionManagerKCM::onNewLogMessage(Log::Level, const QString& s)
|
|||
void PartitionManagerKCM::setupConnections()
|
||||
{
|
||||
connect(&listDevices(), SIGNAL(selectionChanged(const QString&)), &pmWidget(), SLOT(setSelectedDevice(const QString&)));
|
||||
connect(&listDevices(), SIGNAL(deviceActivated(const QString&)), &pmWidget(), SLOT(onPropertiesDevice(const QString&)));
|
||||
connect(&listDevices(), SIGNAL(deviceDoubleClicked(const QString&)), &pmWidget(), SLOT(onPropertiesDevice(const QString&)));
|
||||
}
|
||||
|
||||
void PartitionManagerKCM::on_m_PartitionManagerWidget_operationsChanged()
|
||||
|
|
Loading…
Reference in New Issue