qDebug() << __PRETTY_FUNCTION__;
}
+void ListItemContextButtonBar::hideContextButtonBar()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+}
+
+void ListItemContextButtonBar::onListItemSelectionChanged(bool itemIsSelected)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_contextButtons->setVisible(itemIsSelected);
+}
+
void ListItemContextButtonBar::setContextButtons(QWidget *contextButtons)
{
qDebug() << __PRETTY_FUNCTION__;
const int Y = 0;
move(PANEL_TAB_BAR_WIDTH + PANEL_BAR_WIDTH + FROM_PANEL_CONTENTS_LEFT, Y);
}
+
+void ListItemContextButtonBar::showContextButtonBar()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+}
public:
explicit ListItemContextButtonBar(QWidget *parent = 0);
+ void hideContextButtonBar();
+
/**
* @brief Sets the context buttons to the context button bar
*
*/
void setContextButtons(QWidget *contextButtons);
+ void showContextButtonBar();
+
signals:
public slots:
+ void onListItemSelectionChanged(bool itemIsSelected);
private:
QWidget *m_contextButtons; ///< Widget for context buttons
buildRoutingPanel();
m_tabbedPanel = new TabbedPanel(this);
-
+
//Save Situare related tab indexes so tabs can be enabled/disabled when logged in/out
m_situareTabsIndexes.append(
m_tabbedPanel->addTab(m_userInfoPanel, QIcon(":/res/images/user_info.png")));
connect(m_tabbedPanel, SIGNAL(currentChanged(int)),
m_userInfoPanel, SIGNAL(collapse()));
+
+ // signals for showing and hiding list item context buttons
+ connect(m_friendsListPanel, SIGNAL(listItemSelectionChanged(bool)),
+ m_tabbedPanel, SIGNAL(listItemSelectionChanged(bool)));
+
+ connect(m_locationSearchPanel, SIGNAL(listItemSelectionChanged(bool)),
+ m_tabbedPanel, SIGNAL(listItemSelectionChanged(bool)));
+
+ connect(m_routingPanel, SIGNAL(listItemSelectionChanged(bool)),
+ m_tabbedPanel, SIGNAL(listItemSelectionChanged(bool)));
}
void MainWindow::buildRoutingPanel()
QListWidget *listWidget = dynamic_cast<QListWidget *>(sender());
if (listWidget && (listWidget->selectedItems().count() > 0))
- m_itemButtons->show();
+ emit listItemSelectionChanged(true);
else
- m_itemButtons->hide();
+ emit listItemSelectionChanged(false);
}
*/
void openPanelRequested(QWidget *widget);
+ void listItemSelectionChanged(bool itemIsSelected);
+
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
// --- LIST ITEM RELATED CONTEXT BUTTONS BAR ---
m_itemContextButtonBar = new ListItemContextButtonBar(this);
+ connect(this, SIGNAL(listItemSelectionChanged(bool)),
+ m_itemContextButtonBar, SLOT(onListItemSelectionChanged(bool)));
+
// --- PANEL CONTENT ---
m_panelContentStack = new PanelContentStack(this);
m_panelContentStack->move(PANEL_TAB_BAR_WIDTH + PANEL_BAR_WIDTH, PANEL_TOP_Y);
*/
void currentChanged(int index);
+ void listItemSelectionChanged(bool itemIsSelected);
+
/**
* @brief Signal that is sent when panel is closed
*