Gui: some typedefs for Glib::ustring
...helps to write way shorter signatures
This commit is contained in:
parent
421a81b25b
commit
87c70d0b1f
10 changed files with 30 additions and 28 deletions
|
|
@ -30,8 +30,8 @@ using namespace Glib;
|
|||
namespace gui {
|
||||
namespace dialogs {
|
||||
|
||||
NameChooser::NameChooser(Window &parent, const Glib::ustring title,
|
||||
const Glib::ustring default_name) :
|
||||
NameChooser::NameChooser(Window &parent, cuString title,
|
||||
cuString default_name) :
|
||||
Dialog::Dialog(title, parent, true),
|
||||
caption(_("Name:"))
|
||||
{
|
||||
|
|
@ -60,7 +60,7 @@ NameChooser::NameChooser(Window &parent, const Glib::ustring title,
|
|||
show_all_children();
|
||||
}
|
||||
|
||||
const Glib::ustring NameChooser::get_name() const
|
||||
cuString NameChooser::get_name() const
|
||||
{
|
||||
return name.get_text();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,15 +46,15 @@ public:
|
|||
* @param default_name The name that will be shown by default in the
|
||||
* edit box of the dialog.
|
||||
*/
|
||||
NameChooser(Gtk::Window &parent, const Glib::ustring title,
|
||||
const Glib::ustring default_name);
|
||||
NameChooser(Gtk::Window &parent, cuString title,
|
||||
cuString default_name);
|
||||
|
||||
/**
|
||||
* Gets the current name of the chosen in the dialog.
|
||||
* @return Returns the name currently typed into the edit box of the
|
||||
* dialog.
|
||||
*/
|
||||
const Glib::ustring get_name() const;
|
||||
cuString get_name() const;
|
||||
|
||||
private:
|
||||
Gtk::HBox hBox;
|
||||
|
|
|
|||
|
|
@ -69,6 +69,10 @@
|
|||
|
||||
/** Lumiera GTK GUI implementation root. */
|
||||
namespace gui {
|
||||
|
||||
typedef Glib::ustring uString;
|
||||
typedef const uString cuString;
|
||||
|
||||
|
||||
/** Dialog box classes. */
|
||||
namespace dialogs {}
|
||||
|
|
|
|||
|
|
@ -61,20 +61,18 @@ class GtkLumiera
|
|||
|
||||
WindowManager& windowManager();
|
||||
|
||||
static Glib::ustring get_home_data_path();
|
||||
|
||||
|
||||
/** the name of the application */
|
||||
static const Glib::ustring get_app_title();
|
||||
static cuString getAppTitle();
|
||||
|
||||
static const Glib::ustring get_app_version();
|
||||
static cuString getAppVersion();
|
||||
|
||||
static const Glib::ustring get_app_copyright();
|
||||
static cuString getCopyright();
|
||||
|
||||
static const Glib::ustring get_app_website();
|
||||
static cuString getLumieraWebsite();
|
||||
|
||||
/** alphabetical list of the application's authors */
|
||||
static const std::vector<Glib::ustring> get_app_authors();
|
||||
static const std::vector<uString> getLumieraAuthors();
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ Project::get_sequences()
|
|||
}
|
||||
|
||||
void
|
||||
Project::add_new_sequence(Glib::ustring name)
|
||||
Project::add_new_sequence(uString name)
|
||||
{
|
||||
shared_ptr<Sequence> sequence(new Sequence());
|
||||
sequence->set_name(name);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public:
|
|||
lumiera::observable_list< boost::shared_ptr<Sequence> >&
|
||||
get_sequences();
|
||||
|
||||
void add_new_sequence(Glib::ustring name);
|
||||
void add_new_sequence(uString name);
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ private:
|
|||
/**
|
||||
* The column to use as the label for the combo box widget items.
|
||||
*/
|
||||
Gtk::TreeModelColumn< Glib::ustring > nameColumn;
|
||||
Gtk::TreeModelColumn< uString > nameColumn;
|
||||
};
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ MenuButton::MenuButton(const StockID& stock_id) :
|
|||
setup_button();
|
||||
}
|
||||
|
||||
MenuButton::MenuButton(const Glib::ustring& label, bool mnemonic) :
|
||||
MenuButton::MenuButton(cuString& label, bool mnemonic) :
|
||||
ToggleButton(),
|
||||
caption(label, mnemonic),
|
||||
arrow(arrowType, shadowType)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#ifndef MENU_BUTTON_HPP
|
||||
#define MENU_BUTTON_HPP
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include "gui/gtk-base.hpp"
|
||||
|
||||
namespace gui {
|
||||
namespace widgets {
|
||||
|
|
@ -43,7 +43,7 @@ public:
|
|||
* @remarks With an empty button, you can Gtk::Button::add() a widget
|
||||
* such as a Gtk::Pixmap or Gtk::Box. If you just wish to add a
|
||||
* Gtk::Label, you may want to use the
|
||||
* Gtk::MenuButton(const Glib::ustring& label) ctor directly instead.
|
||||
* Gtk::MenuButton(cuString& label) ctor directly instead.
|
||||
*/
|
||||
MenuButton();
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ public:
|
|||
* able to add a widget in this button since it already has a
|
||||
* Gtk::Label in it
|
||||
*/
|
||||
MenuButton(const Glib::ustring& label, bool mnemonic=false);
|
||||
MenuButton(cuString& label, bool mnemonic=false);
|
||||
|
||||
/**
|
||||
* Gets the menu which will be displayed when the button is clicked
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ Actions::populate_main_actions(Glib::RefPtr<Gtk::UIManager> uiManager)
|
|||
uiManager->insert_action_group(actionGroup);
|
||||
|
||||
//----- Create the UI layout -----//
|
||||
Glib::ustring ui_info =
|
||||
uString ui_info =
|
||||
"<ui>"
|
||||
" <menubar name='MenuBar'>"
|
||||
" <menu action='FileMenu'>"
|
||||
|
|
@ -216,7 +216,7 @@ Actions::populate_show_panel_actions(Glib::RefPtr<Gtk::UIManager> uiManager)
|
|||
for(int i = 0; i < count; i++)
|
||||
{
|
||||
const gchar *stock_id = PanelManager::get_panel_stock_id(i);
|
||||
const ustring name = ustring::compose("Panel%1", i);
|
||||
cuString name = ustring::compose("Panel%1", i);
|
||||
actionGroup->add(Action::create(name, StockID(stock_id)),
|
||||
bind(mem_fun(*this, &Actions::on_menu_show_panel), i));
|
||||
}
|
||||
|
|
@ -225,7 +225,7 @@ Actions::populate_show_panel_actions(Glib::RefPtr<Gtk::UIManager> uiManager)
|
|||
|
||||
for(int i = 0; i < count; i++)
|
||||
{
|
||||
const ustring name = ustring::compose("Panel%1", i);
|
||||
cuString name = ustring::compose("Panel%1", i);
|
||||
uiManager->add_ui(uiManager->new_merge_id(),
|
||||
"/MenuBar/WindowMenu/WindowShowPanel", name, name);
|
||||
}
|
||||
|
|
@ -334,7 +334,7 @@ Actions::on_menu_track_add()
|
|||
void
|
||||
Actions::on_menu_window_new_window()
|
||||
{
|
||||
GtkLumiera::application().windowManager().new_window(
|
||||
GtkLumiera::application().windowManager().newWindow (
|
||||
workspaceWindow.get_project(),
|
||||
workspaceWindow.get_controller());
|
||||
}
|
||||
|
|
@ -361,11 +361,11 @@ Actions::on_menu_help_about()
|
|||
AboutDialog dialog;
|
||||
|
||||
//dialog.set_program_name(AppTitle);
|
||||
dialog.set_version(GtkLumiera::get_app_version());
|
||||
dialog.set_version(GtkLumiera::getAppVersion());
|
||||
//dialog.set_version(AppState::get("version"));
|
||||
dialog.set_copyright(GtkLumiera::get_app_copyright());
|
||||
dialog.set_website(GtkLumiera::get_app_website());
|
||||
dialog.set_authors(GtkLumiera::get_app_authors());
|
||||
dialog.set_copyright(GtkLumiera::getCopyright());
|
||||
dialog.set_website(GtkLumiera::getLumieraWebsite());
|
||||
dialog.set_authors(GtkLumiera::getLumieraAuthors());
|
||||
|
||||
dialog.set_transient_for(workspaceWindow);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue