added simple search;
added localization support for advanced search
This commit is contained in:
parent
3b4075edec
commit
9c80af5a1d
6 changed files with 372 additions and 123 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.2 $
|
||||
Version : $Revision: 1.3 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/Attic/AdvancedSearchEntry.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -66,33 +66,68 @@ using namespace LiveSupport::Core;
|
|||
* A Gtk::VBox with one or more search input fields in it.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.2 $
|
||||
* @version $Revision: 1.3 $
|
||||
*/
|
||||
class AdvancedSearchEntry : public Gtk::VBox,
|
||||
public LocalizedObject
|
||||
{
|
||||
private:
|
||||
|
||||
/**
|
||||
* The type for storing both the metadata and the comparison operator
|
||||
* localizations.
|
||||
*/
|
||||
typedef std::vector<std::pair<Glib::ustring, Glib::ustring> >
|
||||
MapVector;
|
||||
|
||||
/**
|
||||
* The list of possible metadata field names.
|
||||
*/
|
||||
Ptr<MapVector>::Ref metadataTypes;
|
||||
|
||||
/**
|
||||
* The list of possible comparison operators.
|
||||
*/
|
||||
Ptr<MapVector>::Ref operatorTypes;
|
||||
|
||||
/**
|
||||
* The metadata field.
|
||||
*/
|
||||
ComboBoxText * metadataType;
|
||||
ComboBoxText * metadataEntry;
|
||||
|
||||
/**
|
||||
* The operator field.
|
||||
*/
|
||||
ComboBoxText * operatorType;
|
||||
ComboBoxText * operatorEntry;
|
||||
|
||||
/**
|
||||
* The "search for this value" field.
|
||||
*/
|
||||
EntryBin * entryBin;
|
||||
EntryBin * valueEntry;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
AdvancedSearchEntry(void) throw ();
|
||||
|
||||
/**
|
||||
* Read the localized metadata field names.
|
||||
*
|
||||
* @exception std::invalid_argument if some keys are not found in
|
||||
* the resource bundle
|
||||
*/
|
||||
void
|
||||
readMetadataTypes(void) throw (std::invalid_argument);
|
||||
|
||||
/**
|
||||
* Read the localized comparison operator names.
|
||||
*
|
||||
* @exception std::invalid_argument if some keys are not found in
|
||||
* the resource bundle
|
||||
*/
|
||||
void
|
||||
readOperatorTypes(void) throw (std::invalid_argument);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.2 $
|
||||
Version : $Revision: 1.3 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/Attic/AdvancedSearchEntry.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -68,33 +68,37 @@ AdvancedSearchEntry :: AdvancedSearchEntry(Ptr<ResourceBundle>::Ref bundle)
|
|||
Gtk::Box * searchOptionsBox = Gtk::manage(new Gtk::HBox);
|
||||
pack_start(*searchOptionsBox, Gtk::PACK_SHRINK, 5);
|
||||
|
||||
Gtk::Label * searchByLabel;
|
||||
try {
|
||||
Gtk::Label * searchByLabel = Gtk::manage(new Gtk::Label(
|
||||
searchByLabel = Gtk::manage(new Gtk::Label(
|
||||
*getResourceUstring("searchByTextLabel") ));
|
||||
searchOptionsBox->pack_start(*searchByLabel, Gtk::PACK_SHRINK, 0);
|
||||
readMetadataTypes();
|
||||
readOperatorTypes();
|
||||
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
std::exit(1);
|
||||
}
|
||||
metadataType = Gtk::manage(wf->createComboBoxText());
|
||||
metadataType->append_text("Title");
|
||||
metadataType->append_text("Creator");
|
||||
metadataType->append_text("Length");
|
||||
metadataType->set_active_text("Title");
|
||||
searchOptionsBox->pack_start(*metadataType, Gtk::PACK_EXPAND_WIDGET, 0);
|
||||
|
||||
searchOptionsBox->pack_start(*searchByLabel, Gtk::PACK_SHRINK, 0);
|
||||
|
||||
operatorType = Gtk::manage(wf->createComboBoxText());
|
||||
operatorType->append_text("contains");
|
||||
operatorType->append_text("starts with");
|
||||
operatorType->append_text("equals");
|
||||
operatorType->append_text(">=");
|
||||
operatorType->append_text("<=");
|
||||
operatorType->set_active_text("contains");
|
||||
searchOptionsBox->pack_start(*operatorType, Gtk::PACK_EXPAND_WIDGET, 0);
|
||||
metadataEntry = Gtk::manage(wf->createComboBoxText());
|
||||
MapVector::const_iterator it;
|
||||
for (it = metadataTypes->begin(); it != metadataTypes->end(); ++it) {
|
||||
metadataEntry->append_text(it->first);
|
||||
}
|
||||
metadataEntry->set_active_text(metadataTypes->front().first);
|
||||
searchOptionsBox->pack_start(*metadataEntry, Gtk::PACK_EXPAND_WIDGET, 0);
|
||||
|
||||
entryBin = Gtk::manage(wf->createEntryBin());
|
||||
searchOptionsBox->pack_start(*entryBin, Gtk::PACK_EXPAND_WIDGET, 0);
|
||||
operatorEntry = Gtk::manage(wf->createComboBoxText());
|
||||
for (it = operatorTypes->begin(); it != operatorTypes->end(); ++it) {
|
||||
operatorEntry->append_text(it->first);
|
||||
}
|
||||
operatorEntry->set_active_text(operatorTypes->front().first);
|
||||
searchOptionsBox->pack_start(*operatorEntry, Gtk::PACK_EXPAND_WIDGET, 0);
|
||||
|
||||
valueEntry = Gtk::manage(wf->createEntryBin());
|
||||
searchOptionsBox->pack_start(*valueEntry, Gtk::PACK_EXPAND_WIDGET, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -105,42 +109,43 @@ Ptr<SearchCriteria>::Ref
|
|||
AdvancedSearchEntry :: getSearchCriteria(void) throw ()
|
||||
{
|
||||
Ptr<SearchCriteria>::Ref criteria(new SearchCriteria("all"));
|
||||
|
||||
std::string key;
|
||||
if (metadataType->get_active_text() == "Title") {
|
||||
key = "dc:title";
|
||||
} else if (metadataType->get_active_text() == "Creator") {
|
||||
key = "dc:creator";
|
||||
} else if (metadataType->get_active_text() == "Length") {
|
||||
key = "dcterms:extent";
|
||||
} else {
|
||||
std::cerr << "unknown metadata type in advanced search entry"
|
||||
<< std::endl
|
||||
<< "(this should never happen)" << std::endl;
|
||||
|
||||
std::string metadataName = metadataEntry->get_active_text();
|
||||
std::string metadataKey;
|
||||
bool found = false;
|
||||
MapVector::const_iterator it;
|
||||
for (it = metadataTypes->begin(); it != metadataTypes->end(); ++it) {
|
||||
if (it->first == metadataName) {
|
||||
found = true;
|
||||
metadataKey = it->second;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
std::cerr << "unknown metadata type: " << metadataName
|
||||
<< std::endl << "(this should never happen)" << std::endl;
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
std::string comparisonOperator;
|
||||
if (operatorType->get_active_text() == "contains") {
|
||||
comparisonOperator = "partial";
|
||||
} else if (operatorType->get_active_text() == "starts with") {
|
||||
comparisonOperator = "prefix";
|
||||
} else if (operatorType->get_active_text() == "equals") {
|
||||
comparisonOperator = "=";
|
||||
} else if (operatorType->get_active_text() == ">=") {
|
||||
comparisonOperator = ">=";
|
||||
} else if (operatorType->get_active_text() == "<=") {
|
||||
comparisonOperator = "<=";
|
||||
} else {
|
||||
std::cerr << "unknown comparison operator in advanced search entry"
|
||||
<< std::endl
|
||||
<< "(this should never happen)" << std::endl;
|
||||
std::string operatorName = operatorEntry->get_active_text();
|
||||
std::string operatorKey;
|
||||
found = false;
|
||||
for (it = operatorTypes->begin(); it != operatorTypes->end(); ++it) {
|
||||
if (it->first == operatorName) {
|
||||
found = true;
|
||||
operatorKey = it->second;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
std::cerr << "unknown comparison operator: " << operatorName
|
||||
<< std::endl << "(this should never happen)" << std::endl;
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
std::string value = entryBin->get_text();
|
||||
std::string value = valueEntry->get_text();
|
||||
|
||||
criteria->addCondition(key, comparisonOperator, value);
|
||||
criteria->addCondition(metadataKey, operatorKey, value);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
|
@ -152,6 +157,54 @@ void
|
|||
AdvancedSearchEntry :: connectCallback(const sigc::slot<void> & callback)
|
||||
throw ()
|
||||
{
|
||||
entryBin->signal_activate().connect(callback);
|
||||
valueEntry->signal_activate().connect(callback);
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Read the localized metadata field names.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
AdvancedSearchEntry :: readMetadataTypes(void)
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
metadataTypes.reset(new MapVector);
|
||||
|
||||
metadataTypes->push_back(std::make_pair(
|
||||
*getResourceUstring("titleMetadataDisplay"),
|
||||
*getResourceUstring("titleMetadataSearchKey") ));
|
||||
metadataTypes->push_back(std::make_pair(
|
||||
*getResourceUstring("creatorMetadataDisplay"),
|
||||
*getResourceUstring("creatorMetadataSearchKey") ));
|
||||
metadataTypes->push_back(std::make_pair(
|
||||
*getResourceUstring("lengthMetadataDisplay"),
|
||||
*getResourceUstring("lengthMetadataSearchKey") ));
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Read the localized comparison operator names.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
AdvancedSearchEntry :: readOperatorTypes(void)
|
||||
throw (std::invalid_argument)
|
||||
{
|
||||
operatorTypes.reset(new MapVector);
|
||||
|
||||
operatorTypes->push_back(std::make_pair(
|
||||
*getResourceUstring("partialOperatorDisplay"),
|
||||
*getResourceUstring("partialOperatorSearchKey") ));
|
||||
operatorTypes->push_back(std::make_pair(
|
||||
*getResourceUstring("prefixOperatorDisplay"),
|
||||
*getResourceUstring("prefixOperatorSearchKey") ));
|
||||
operatorTypes->push_back(std::make_pair(
|
||||
*getResourceUstring("=OperatorDisplay"),
|
||||
*getResourceUstring("=OperatorSearchKey") ));
|
||||
operatorTypes->push_back(std::make_pair(
|
||||
*getResourceUstring("<=OperatorDisplay"),
|
||||
*getResourceUstring("<=OperatorSearchKey") ));
|
||||
operatorTypes->push_back(std::make_pair(
|
||||
*getResourceUstring(">=OperatorDisplay"),
|
||||
*getResourceUstring(">=OperatorSearchKey") ));
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.5 $
|
||||
Version : $Revision: 1.6 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SearchWindow.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -77,16 +77,18 @@ SearchWindow :: SearchWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
this->gLiveSupport = gLiveSupport;
|
||||
treeModel = Gtk::ListStore::create(modelColumns);
|
||||
|
||||
Gtk::VBox * searchView = Gtk::manage(new Gtk::VBox);
|
||||
Gtk::VBox * advancedSearchView = constructAdvancedSearchView();
|
||||
Gtk::VBox * browseView = Gtk::manage(new Gtk::VBox);
|
||||
Gtk::Box * simpleSearchView = constructSimpleSearchView();
|
||||
Gtk::Box * advancedSearchView = constructAdvancedSearchView();
|
||||
Gtk::Box * browseView = constructBrowseView();
|
||||
|
||||
Notebook * views = Gtk::manage(new Notebook);
|
||||
try {
|
||||
views->appendPage(*searchView, *getResourceUstring("searchTab"));
|
||||
views->appendPage(*simpleSearchView, *getResourceUstring(
|
||||
"simpleSearchTab"));
|
||||
views->appendPage(*advancedSearchView, *getResourceUstring(
|
||||
"advancedSearchTab"));
|
||||
views->appendPage(*browseView, *getResourceUstring("browseTab"));
|
||||
views->appendPage(*browseView, *getResourceUstring(
|
||||
"browseTab"));
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
std::exit(1);
|
||||
|
@ -96,7 +98,7 @@ SearchWindow :: SearchWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
|
||||
// show
|
||||
set_name("searchWindow");
|
||||
set_default_size(450, 350);
|
||||
set_default_size(450, 250);
|
||||
set_modal(false);
|
||||
property_window_position().set_value(Gtk::WIN_POS_NONE);
|
||||
|
||||
|
@ -113,6 +115,46 @@ SearchWindow :: ~SearchWindow (void) throw ()
|
|||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Construct the simple search view.
|
||||
*----------------------------------------------------------------------------*/
|
||||
Gtk::VBox*
|
||||
SearchWindow :: constructSimpleSearchView(void) throw ()
|
||||
{
|
||||
Ptr<WidgetFactory>::Ref wf = WidgetFactory::getInstance();
|
||||
|
||||
// set up the entry box
|
||||
simpleSearchEntry = Gtk::manage(wf->createEntryBin());
|
||||
|
||||
Button * searchButton;
|
||||
try {
|
||||
searchButton = Gtk::manage(wf->createButton(
|
||||
*getResourceUstring("searchButtonLabel") ));
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
simpleSearchEntry->signal_activate().connect(sigc::mem_fun(
|
||||
*this, &SearchWindow::onSimpleSearch ));
|
||||
searchButton->signal_clicked().connect(sigc::mem_fun(
|
||||
*this, &SearchWindow::onSimpleSearch ));
|
||||
|
||||
Gtk::HBox * entryBox = Gtk::manage(new Gtk::HBox);
|
||||
entryBox->pack_start(*simpleSearchEntry, Gtk::PACK_SHRINK, 5);
|
||||
entryBox->pack_start(*searchButton, Gtk::PACK_SHRINK, 5);
|
||||
|
||||
// set up the search results display
|
||||
ZebraTreeView * searchResults = constructSearchResults();
|
||||
|
||||
// make a new box and pack the main components into it
|
||||
Gtk::VBox * view = Gtk::manage(new Gtk::VBox);
|
||||
view->pack_start(*entryBox, Gtk::PACK_EXPAND_WIDGET, 5);
|
||||
view->pack_start(*searchResults, Gtk::PACK_EXPAND_WIDGET, 5);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Construct the advanced search view.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
@ -122,16 +164,62 @@ SearchWindow :: constructAdvancedSearchView(void) throw ()
|
|||
Ptr<WidgetFactory>::Ref wf = WidgetFactory::getInstance();
|
||||
|
||||
// the three main components of the window
|
||||
advancedSearchOptions = Gtk::manage(new AdvancedSearchEntry(getBundle()));
|
||||
Gtk::Box * searchButtonBox = Gtk::manage(new Gtk::HButtonBox(
|
||||
advancedSearchEntry = Gtk::manage(new AdvancedSearchEntry(getBundle()));
|
||||
Gtk::Box * searchButtonBox = Gtk::manage(new Gtk::HButtonBox(
|
||||
Gtk::BUTTONBOX_END ));
|
||||
ZebraTreeView * searchResults = Gtk::manage(wf->createTreeView(
|
||||
treeModel ));
|
||||
|
||||
// set up the callback function for the entry field
|
||||
advancedSearchOptions->connectCallback(sigc::mem_fun(*this,
|
||||
&SearchWindow::onSearch));
|
||||
ZebraTreeView * searchResults = constructSearchResults();
|
||||
|
||||
// set up the callback function for the entry field
|
||||
advancedSearchEntry->connectCallback(sigc::mem_fun(
|
||||
*this, &SearchWindow::onAdvancedSearch ));
|
||||
|
||||
// set up the search button box
|
||||
try {
|
||||
Button * searchButton = Gtk::manage(wf->createButton(
|
||||
*getResourceUstring("searchButtonLabel") ));
|
||||
searchButton->signal_clicked().connect(sigc::mem_fun(
|
||||
*this, &SearchWindow::onAdvancedSearch ));
|
||||
searchButtonBox->pack_start(*searchButton, Gtk::PACK_SHRINK, 5);
|
||||
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
// make a new box and pack the main components into it
|
||||
Gtk::VBox * view = Gtk::manage(new Gtk::VBox);
|
||||
view->pack_start(*advancedSearchEntry, Gtk::PACK_SHRINK, 5);
|
||||
view->pack_start(*searchButtonBox, Gtk::PACK_SHRINK, 5);
|
||||
view->pack_start(*searchResults, Gtk::PACK_EXPAND_WIDGET, 5);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Construct the browse view.
|
||||
*----------------------------------------------------------------------------*/
|
||||
Gtk::VBox*
|
||||
SearchWindow :: constructBrowseView(void) throw ()
|
||||
{
|
||||
Ptr<WidgetFactory>::Ref wf = WidgetFactory::getInstance();
|
||||
|
||||
Gtk::VBox * view = Gtk::manage(new Gtk::VBox);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Construct the search results display.
|
||||
*----------------------------------------------------------------------------*/
|
||||
ZebraTreeView*
|
||||
SearchWindow :: constructSearchResults(void) throw ()
|
||||
{
|
||||
Ptr<WidgetFactory>::Ref wf = WidgetFactory::getInstance();
|
||||
|
||||
ZebraTreeView * searchResults = Gtk::manage(wf->createTreeView(
|
||||
treeModel ));
|
||||
|
||||
// add the TreeView's view columns
|
||||
try {
|
||||
searchResults->appendColumn(*getResourceUstring("typeColumnLabel"),
|
||||
|
@ -150,36 +238,34 @@ SearchWindow :: constructAdvancedSearchView(void) throw ()
|
|||
// color the rows blue and gray
|
||||
searchResults->setCellDataFunction();
|
||||
|
||||
// make a new box, and pack the main components into it
|
||||
Gtk::VBox * view = Gtk::manage(new Gtk::VBox);
|
||||
view->pack_start(*advancedSearchOptions, Gtk::PACK_SHRINK, 5);
|
||||
view->pack_start(*searchButtonBox, Gtk::PACK_SHRINK, 5);
|
||||
view->pack_start(*searchResults, Gtk::PACK_SHRINK, 5);
|
||||
|
||||
// set up the search button box
|
||||
try {
|
||||
Button * searchButton = Gtk::manage(wf->createButton(
|
||||
*getResourceUstring("searchButtonLabel") ));
|
||||
searchButton->signal_clicked().connect(sigc::mem_fun(*this,
|
||||
&SearchWindow::onSearchButtonClicked));
|
||||
searchButtonBox->pack_start(*searchButton, Gtk::PACK_SHRINK, 5);
|
||||
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
return view;
|
||||
return searchResults;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Event handler for the Search button getting clicked.
|
||||
* Event handler for the simple Search button getting clicked.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SearchWindow :: onSearchButtonClicked(void) throw ()
|
||||
SearchWindow :: onSimpleSearch(void) throw ()
|
||||
{
|
||||
onSearch();
|
||||
Glib::ustring value = simpleSearchEntry->get_text();
|
||||
|
||||
Ptr<SearchCriteria>::Ref criteria(new SearchCriteria("all", "or"));
|
||||
criteria->addCondition("dc:title", "partial", value); // id3v2 Title
|
||||
criteria->addCondition("dc:creator", "partial", value); // id3v2 Artist
|
||||
criteria->addCondition("dc:source", "partial", value); // id3v2 Album
|
||||
|
||||
onSearch(criteria);
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Event handler for the advanced Search button getting clicked.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SearchWindow :: onAdvancedSearch(void) throw ()
|
||||
{
|
||||
onSearch(advancedSearchEntry->getSearchCriteria());
|
||||
}
|
||||
|
||||
|
||||
|
@ -187,10 +273,9 @@ SearchWindow :: onSearchButtonClicked(void) throw ()
|
|||
* Do the searching.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SearchWindow :: onSearch(void) throw ()
|
||||
SearchWindow :: onSearch(Ptr<SearchCriteria>::Ref criteria)
|
||||
throw ()
|
||||
{
|
||||
Ptr<SearchCriteria>::Ref criteria = advancedSearchOptions
|
||||
->getSearchCriteria();
|
||||
Ptr<std::list<Ptr<Playable>::Ref> >::Ref
|
||||
searchResults = gLiveSupport->search(criteria);
|
||||
std::list<Ptr<Playable>::Ref>::const_iterator it;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.4 $
|
||||
Version : $Revision: 1.5 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SearchWindow.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -71,16 +71,34 @@ using namespace LiveSupport::Widgets;
|
|||
* The Search/Browse window.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.4 $
|
||||
* @version $Revision: 1.5 $
|
||||
*/
|
||||
class SearchWindow : public WhiteWindow, public LocalizedObject
|
||||
{
|
||||
private:
|
||||
|
||||
/**
|
||||
* The simple search input field.
|
||||
*/
|
||||
EntryBin * simpleSearchEntry;
|
||||
|
||||
/**
|
||||
* The box containing the advanced search input fields.
|
||||
*/
|
||||
AdvancedSearchEntry * advancedSearchOptions;
|
||||
AdvancedSearchEntry * advancedSearchEntry;
|
||||
|
||||
/**
|
||||
* Construct the simple search view.
|
||||
* If you enter a string in the simple search view and press Enter
|
||||
* (or the Search button), the local storage will be searched for
|
||||
* items (both audio clips and playlists) where either the title
|
||||
* (dc:title), the creator (dc:creator) or the album (dc:source)
|
||||
* metadata fields contain this string.
|
||||
*
|
||||
* @return a pointer to the new box (already Gtk::manage()'ed)
|
||||
*/
|
||||
Gtk::VBox*
|
||||
constructSimpleSearchView(void) throw ();
|
||||
|
||||
/**
|
||||
* Construct the advanced search view.
|
||||
|
@ -91,23 +109,45 @@ class SearchWindow : public WhiteWindow, public LocalizedObject
|
|||
constructAdvancedSearchView(void) throw ();
|
||||
|
||||
/**
|
||||
* Event handler for the Search button getting clicked.
|
||||
* Construct the browse view.
|
||||
*
|
||||
* @return a pointer to the new box (already Gtk::manage()'ed)
|
||||
*/
|
||||
Gtk::VBox*
|
||||
constructBrowseView(void) throw ();
|
||||
|
||||
/**
|
||||
* Construct the search results display.
|
||||
*
|
||||
* @return a pointer to the new TreeView (already Gtk::manage()'ed)
|
||||
*/
|
||||
ZebraTreeView*
|
||||
constructSearchResults(void) throw ();
|
||||
|
||||
/**
|
||||
* Event handler for the simple Search button getting clicked.
|
||||
*/
|
||||
void
|
||||
onSearchButtonClicked(void) throw ();
|
||||
onSimpleSearch(void) throw ();
|
||||
|
||||
/**
|
||||
* Event handler for the advanced Search button getting clicked.
|
||||
*/
|
||||
void
|
||||
onAdvancedSearch(void) throw ();
|
||||
|
||||
/**
|
||||
* Do the searching.
|
||||
*/
|
||||
void
|
||||
onSearch(void) throw ();
|
||||
onSearch(Ptr<SearchCriteria>::Ref criteria) throw ();
|
||||
|
||||
/**
|
||||
* The columns model needed by Gtk::TreeView.
|
||||
* Lists one clip per row.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.4 $
|
||||
* @version $Revision: 1.5 $
|
||||
*/
|
||||
class ModelColumns : public ZebraTreeModelColumnRecord
|
||||
{
|
||||
|
|
|
@ -12,15 +12,15 @@ hu:table
|
|||
searchButtonLabel:string { "keresés" }
|
||||
|
||||
localeNotAvailableMsg:string { "A {0} nyelv nem elérhető" }
|
||||
schedulerNotReachableMsg:string { "Az időzitő szerver nem elérhető" }
|
||||
storageNotReachableMsg:string { "Az tároló szerver nem elérhető" }
|
||||
schedulerNotReachableMsg:string { "Az időzítő szerver nem elérhető" }
|
||||
storageNotReachableMsg:string { "A tároló szerver nem elérhető" }
|
||||
authenticationNotReachableMsg:string { "A beléptető szerver nem elérhető" }
|
||||
|
||||
loginWindow:table
|
||||
{
|
||||
windowTitle:string { "Belépés" }
|
||||
|
||||
loginLabel:string { "Azonositó" }
|
||||
loginLabel:string { "Azonosító" }
|
||||
passwordLabel:string { "Jelszó" }
|
||||
okButtonLabel:string { "Belépés" }
|
||||
cancelButtonLabel:string { "Mégsem" }
|
||||
|
@ -28,9 +28,9 @@ hu:table
|
|||
|
||||
audioClipListWindow:table
|
||||
{
|
||||
windowTitle:string { "LiveSupport Hang Anyag Ablak" }
|
||||
windowTitle:string { "LiveSupport Hanganyag ablak" }
|
||||
|
||||
idColumnLabel:string { "azonositó" }
|
||||
idColumnLabel:string { "azonosító" }
|
||||
lengthColumnLabel:string { "hossz" }
|
||||
uriColumnLabel:string { "URI" }
|
||||
tokenColumnLabel:string { "token" }
|
||||
|
@ -40,7 +40,7 @@ hu:table
|
|||
|
||||
scratchpadWindow:table
|
||||
{
|
||||
windowTitle:string { "LiveSupport Praktikus Csupor" }
|
||||
windowTitle:string { "LiveSupport Praktikus csupor" }
|
||||
|
||||
typeColumnLabel:string { "típus" }
|
||||
titleColumnLabel:string { "cím" }
|
||||
|
@ -50,7 +50,7 @@ hu:table
|
|||
upMenuItem:string { "_Fel" }
|
||||
downMenuItem:string { "_Le" }
|
||||
removeMenuItem:string { "_Eltávolít" }
|
||||
addToPlaylistMenuItem:string { "_Hozzáad Playlist-hez" }
|
||||
addToPlaylistMenuItem:string { "_Hozzáad Playlisthez" }
|
||||
schedulePlaylistMenuItem:string { "_Playlist időzítése" }
|
||||
deleteMenuItem:string { "_Töröl" }
|
||||
playMenuItem:string { "Le_játszâs" }
|
||||
|
@ -58,12 +58,12 @@ hu:table
|
|||
|
||||
playlistListWindow:table
|
||||
{
|
||||
windowTitle:string { "LiveSupport Playlist Ablak" }
|
||||
windowTitle:string { "LiveSupport Playlist ablak" }
|
||||
|
||||
listBoxLabel { "Playlistek" }
|
||||
detailBoxLabel { "Playlist részletek" }
|
||||
|
||||
idColumnLabel:string { "azonositó" }
|
||||
idColumnLabel:string { "azonosító" }
|
||||
lengthColumnLabel:string { "hossz" }
|
||||
uriColumnLabel:string { "URI" }
|
||||
tokenColumnLabel:string { "token" }
|
||||
|
@ -73,29 +73,29 @@ hu:table
|
|||
|
||||
uploadFileWindow:table
|
||||
{
|
||||
windowTitle:string { "File Feltőltés" }
|
||||
windowTitle:string { "File feltöltés" }
|
||||
|
||||
chooseFileLabel:string { "Filenév" }
|
||||
chooseFileButtonLabel:string { "Tallóz" }
|
||||
|
||||
mainSectionLabel:string { "Fő" }
|
||||
titleLabel:string { "Cim" }
|
||||
mainSectionLabel:string { "Általános" }
|
||||
titleLabel:string { "Cím" }
|
||||
creatorLabel:string { "Szerző" }
|
||||
genreLabel:string { "Stilus" }
|
||||
fileFormatLabel:string { "File tipus" }
|
||||
genreLabel:string { "Stílus" }
|
||||
fileFormatLabel:string { "File típusa" }
|
||||
lengthLabel:string { "Hossz" }
|
||||
|
||||
uploadButtonLabel:string { "feltölt" }
|
||||
closeButtonLabel:string { "bezár" }
|
||||
statusBar:string { "állapotsor" }
|
||||
|
||||
fileChooserDialogTitle:string { "File Választás" }
|
||||
clipUploadedMessage:string { "hang file {0} feltöltve" }
|
||||
fileChooserDialogTitle:string { "File Kiválasztása" }
|
||||
clipUploadedMessage:string { "hangfile {0} feltöltve" }
|
||||
}
|
||||
|
||||
simplePlaylistManagementWindow:table
|
||||
{
|
||||
windowTitle:string { "LiveSupport Egyszerű Playlist Szerkesztő Ablak" }
|
||||
windowTitle:string { "LiveSupport Egyszerű playlistszerkesztő ablak" }
|
||||
|
||||
startColumnLabel:string { "kezdet" }
|
||||
titleColumnLabel:string { "cím" }
|
||||
|
@ -114,7 +114,7 @@ hu:table
|
|||
startColumnLabel:string { "kezdet" }
|
||||
titleColumnLabel:string { "cím" }
|
||||
endColumnLabel:string { "vég" }
|
||||
deleteMenuItem:string { "_Töröl" }
|
||||
deleteMenuItem:string { "_töröl" }
|
||||
|
||||
closeButtonLabel:string { "bezár" }
|
||||
}
|
||||
|
@ -133,9 +133,9 @@ hu:table
|
|||
{
|
||||
windowTitle:string { "LiveSupport Keresés Ablak" }
|
||||
|
||||
searchTab:string { "Keresés" }
|
||||
simpleSearchTab:string { "Keresés" }
|
||||
advancedSearchTab:string { "Összetett keresés" }
|
||||
browseTab:string { "Nézelődés" }
|
||||
browseTab:string { "Böngészés" }
|
||||
|
||||
searchByTextLabel:string { "Keresési feltétel:" }
|
||||
searchButtonLabel:string { "Keress!" }
|
||||
|
@ -144,6 +144,24 @@ hu:table
|
|||
titleColumnLabel:string { "Cím" }
|
||||
creatorColumnLabel:string { "Előadó" }
|
||||
lengthColumnLabel:string { "Hossz" }
|
||||
|
||||
titleMetadataDisplay:string { "Cím" }
|
||||
titleMetadataSearchKey:string { "dc:title" }
|
||||
creatorMetadataDisplay:string { "Előadó" }
|
||||
creatorMetadataSearchKey:string { "dc:creator" }
|
||||
lengthMetadataDisplay:string { "Hossz" }
|
||||
lengthMetadataSearchKey:string { "dcterms:extent" }
|
||||
|
||||
partialOperatorDisplay:string { "része" }
|
||||
partialOperatorSearchKey:string { "partial" }
|
||||
prefixOperatorDisplay:string { "kezdete" }
|
||||
prefixOperatorSearchKey:string { "prefix" }
|
||||
=OperatorDisplay:string { "=" }
|
||||
=OperatorSearchKey:string { "=" }
|
||||
<=OperatorDisplay:string { "<=" }
|
||||
<=OperatorSearchKey:string { "<=" }
|
||||
>=OperatorDisplay:string { ">=" }
|
||||
>=OperatorSearchKey:string { ">=" }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ root:table
|
|||
{
|
||||
windowTitle:string { "LiveSupport Search/Browse Window" }
|
||||
|
||||
searchTab:string { "Search" }
|
||||
simpleSearchTab:string { "Search" }
|
||||
advancedSearchTab:string { "Advanced Search" }
|
||||
browseTab:string { "Browse" }
|
||||
|
||||
|
@ -146,6 +146,24 @@ root:table
|
|||
titleColumnLabel:string { "Title" }
|
||||
creatorColumnLabel:string { "Creator" }
|
||||
lengthColumnLabel:string { "Length" }
|
||||
|
||||
titleMetadataDisplay:string { "Title" }
|
||||
titleMetadataSearchKey:string { "dc:title" }
|
||||
creatorMetadataDisplay:string { "Creator" }
|
||||
creatorMetadataSearchKey:string { "dc:creator" }
|
||||
lengthMetadataDisplay:string { "Length" }
|
||||
lengthMetadataSearchKey:string { "dcterms:extent" }
|
||||
|
||||
partialOperatorDisplay:string { "contains" }
|
||||
partialOperatorSearchKey:string { "partial" }
|
||||
prefixOperatorDisplay:string { "starts with" }
|
||||
prefixOperatorSearchKey:string { "prefix" }
|
||||
=OperatorDisplay:string { "equals" }
|
||||
=OperatorSearchKey:string { "=" }
|
||||
<=OperatorDisplay:string { "<=" }
|
||||
<=OperatorSearchKey:string { "<=" }
|
||||
>=OperatorDisplay:string { ">=" }
|
||||
>=OperatorSearchKey:string { ">=" }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue