fixed #2044
This commit is contained in:
parent
fafbf6e87b
commit
3fd1e71d51
|
@ -117,7 +117,7 @@ class Notebook : public Gtk::Alignment
|
|||
virtual void
|
||||
onTabClicked(void) throw ()
|
||||
{
|
||||
notebook->activatePage(index);
|
||||
notebook->setActivePage(index);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -304,13 +304,34 @@ class Notebook : public Gtk::Alignment
|
|||
appendPage(Gtk::Widget & widget,
|
||||
const Glib::ustring & label) throw ();
|
||||
|
||||
/**
|
||||
* Get the number of the active page.
|
||||
*
|
||||
* @return the index of the active page.
|
||||
*/
|
||||
virtual unsigned int
|
||||
getActivePage(void) throw ()
|
||||
{
|
||||
return activePage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a specific page active.
|
||||
*
|
||||
* @param pageNo the index of the page to make active.
|
||||
*/
|
||||
virtual void
|
||||
activatePage(unsigned int pageNo) throw ();
|
||||
setActivePage(unsigned int pageNo) throw ();
|
||||
|
||||
/**
|
||||
* Enable or disable a page in the notebook.
|
||||
*
|
||||
* @param pageNo the index of the page to enable or disable.
|
||||
* @param sensitive true (default) to enable, false to disable.
|
||||
*/
|
||||
virtual void
|
||||
setPageSensitive(unsigned int pageNo,
|
||||
bool sensitive) throw ();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -246,7 +246,7 @@ Notebook :: pagesAdded(void) throw ()
|
|||
}
|
||||
|
||||
// reset the active page to 0, and show it
|
||||
activatePage(0);
|
||||
setActivePage(0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -254,7 +254,7 @@ Notebook :: pagesAdded(void) throw ()
|
|||
* Make a page active
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
Notebook :: activatePage(unsigned int pageNo) throw ()
|
||||
Notebook :: setActivePage(unsigned int pageNo) throw ()
|
||||
{
|
||||
if (pageNo >= pageList.size()) {
|
||||
return;
|
||||
|
@ -270,3 +270,15 @@ Notebook :: activatePage(unsigned int pageNo) throw ()
|
|||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Enable or disable a page in the notebook.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
Notebook :: setPageSensitive(unsigned int pageNo,
|
||||
bool sensitive) throw ()
|
||||
{
|
||||
if (pageNo < pageList.size()) {
|
||||
pageList[pageNo]->button->setDisabled(!sensitive);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -967,7 +967,7 @@ OptionsWindow :: resetEditedKeyBinding(void) throw ()
|
|||
void
|
||||
OptionsWindow :: run(void) throw ()
|
||||
{
|
||||
mainNotebook->activatePage(2); // "Servers"
|
||||
mainNotebook->setActivePage(2); // "Servers"
|
||||
property_window_position().set_value(Gtk::WIN_POS_CENTER_ALWAYS);
|
||||
show_all();
|
||||
Gtk::Main::run(*this);
|
||||
|
|
|
@ -991,7 +991,7 @@ bool
|
|||
SearchWindow :: uploadToHub(Ptr<Playable>::Ref playable) throw ()
|
||||
{
|
||||
try {
|
||||
searchInput->activatePage(3);
|
||||
searchInput->setActivePage(3);
|
||||
transportList->addUpload(playable);
|
||||
|
||||
} catch (XmlRpcException &e) {
|
||||
|
@ -1020,7 +1020,7 @@ SearchWindow :: onDownloadFromHub(void) throw ()
|
|||
if (playable) {
|
||||
if (!gLiveSupport->existsPlayable(playable->getId())) {
|
||||
try {
|
||||
searchInput->activatePage(3);
|
||||
searchInput->setActivePage(3);
|
||||
transportList->addDownload(playable);
|
||||
|
||||
} catch (XmlRpcException &e) {
|
||||
|
@ -1093,8 +1093,13 @@ void
|
|||
SearchWindow :: onSearchWhereChanged(void) throw ()
|
||||
{
|
||||
if (searchIsLocal()) {
|
||||
searchInput->setPageSensitive(2, true);
|
||||
searchResultsTreeView->set_model(localSearchResults);
|
||||
} else {
|
||||
if (searchInput->getActivePage() == 2) {
|
||||
searchInput->setActivePage(0);
|
||||
}
|
||||
searchInput->setPageSensitive(2, false);
|
||||
searchResultsTreeView->set_model(remoteSearchResults);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue