mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 07:29:33 -05:00
added status combobox to statusbar in MainWindow (initial code from defnax)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3305 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0049549eb7
commit
3baae3a602
@ -239,7 +239,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
|
||||
connect(grp, SIGNAL(triggered(QAction *)), ui.stackPages, SLOT(showPage(QAction *)));
|
||||
|
||||
#ifdef UNFINISHED
|
||||
#ifdef UNFINISHED
|
||||
ui.toolBar->addSeparator();
|
||||
addAction(new QAction(QIcon(IMAGE_UNFINISHED), tr("Unfinished"), ui.toolBar), SLOT(showApplWindow()));
|
||||
#endif
|
||||
@ -248,13 +248,26 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
grp->actions()[0]->setChecked(true);
|
||||
|
||||
/** StatusBar section ********/
|
||||
/* initialize combobox in status bar */
|
||||
statusComboBox = new QComboBox(statusBar());
|
||||
initializeStatusObject(statusComboBox);
|
||||
connect(statusComboBox, SIGNAL(activated(int)), this, SLOT(statusChangedComboBox(int)));
|
||||
|
||||
QWidget *widget = new QWidget();
|
||||
QHBoxLayout *hbox = new QHBoxLayout();
|
||||
hbox->setMargin(0);
|
||||
hbox->setSpacing(6);
|
||||
hbox->addWidget(statusComboBox);
|
||||
widget->setLayout(hbox);
|
||||
statusBar()->addWidget(widget);
|
||||
|
||||
peerstatus = new PeerStatus();
|
||||
statusBar()->addWidget(peerstatus);
|
||||
|
||||
natstatus = new NATStatus();
|
||||
statusBar()->addWidget(natstatus);
|
||||
|
||||
QWidget *widget = new QWidget();
|
||||
widget = new QWidget();
|
||||
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
||||
sizePolicy.setHorizontalStretch(0);
|
||||
sizePolicy.setVerticalStretch(0);
|
||||
@ -284,6 +297,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
|
||||
loadOwnStatus(); // hack; placed in constructor to preempt sendstatus, so status loaded from file
|
||||
|
||||
/* Set focus to the current page */
|
||||
ui.stackPages->currentWidget()->setFocus();
|
||||
|
||||
idle = new Idle();
|
||||
idle->start();
|
||||
connect(idle, SIGNAL(secondsIdle(int)), this, SLOT(checkAndSetIdle(int)));
|
||||
@ -993,3 +1009,13 @@ void MainWindow::statusChanged(QAction *pAction)
|
||||
|
||||
setStatus(pAction->parent(), pAction->data().toInt());
|
||||
}
|
||||
|
||||
/* new status from combobox in statusbar */
|
||||
void MainWindow::statusChangedComboBox(int index)
|
||||
{
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
setStatus(statusComboBox, statusComboBox->itemData(index, Qt::UserRole).toInt());
|
||||
}
|
||||
|
@ -182,6 +182,7 @@ private slots:
|
||||
void showSettings();
|
||||
void setStyle();
|
||||
void statusChanged(QAction *pAction);
|
||||
void statusChangedComboBox(int index);
|
||||
|
||||
/** Called when user attempts to quit via quit button*/
|
||||
void doQuit();
|
||||
@ -226,6 +227,7 @@ private:
|
||||
PeerStatus *peerstatus;
|
||||
NATStatus *natstatus;
|
||||
RatesStatus *ratesstatus;
|
||||
QComboBox *statusComboBox;
|
||||
|
||||
QLabel *_hashing_info_label ;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user