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