summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/document-properties.cpp
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2012-12-16 05:41:25 +0000
committer~suv <suv-sf@users.sourceforge.net>2012-12-16 05:41:25 +0000
commit7ec903c9898f872dbd9426ed7a62e1969fdb7be7 (patch)
treea306139e829118a83516af02279c9eafd3440eaa /src/ui/dialog/document-properties.cpp
parentHershey Text: whitespace; py: docstring, modeline; inx: fix attribute value (diff)
parentTranslations.Spanish translation update by Lucas Vieites. (diff)
downloadinkscape-7ec903c9898f872dbd9426ed7a62e1969fdb7be7.tar.gz
inkscape-7ec903c9898f872dbd9426ed7a62e1969fdb7be7.zip
merge from trunk (r11955)
(bzr r11687.1.3)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
-rw-r--r--src/ui/dialog/document-properties.cpp86
1 files changed, 39 insertions, 47 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index c7be0877d..ab1e8fbd8 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -150,6 +150,7 @@ DocumentProperties::DocumentProperties()
_notebook.append_page(_page_metadata1, _("Metadata"));
_notebook.append_page(_page_metadata2, _("License"));
+ _wr.setUpdating (true);
build_page();
build_guides();
build_gridspage();
@@ -159,6 +160,7 @@ DocumentProperties::DocumentProperties()
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
build_scripting();
build_metadata();
+ _wr.setUpdating (false);
_grids_button_new.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::onNewGrid));
_grids_button_remove.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::onRemoveGrid));
@@ -201,41 +203,36 @@ DocumentProperties::~DocumentProperties()
* widget in columns 2-3; (non-0, 0) means label in columns 1-3; and
* (non-0, non-0) means two widgets in columns 2 and 3.
*/
-inline void attach_all(Gtk::Table &table, Gtk::Widget *const arr[], unsigned const n, int start = 0)
+inline void attach_all(Gtk::Table &table, Gtk::Widget *const arr[], unsigned const n, int start = 0, int docum_prop_flag = 0)
{
- for (unsigned i = 0, r = start; i < n; i += 2)
- {
- if (arr[i] && arr[i+1])
- {
- table.attach(*arr[i], 1, 2, r, r+1,
- Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0);
- table.attach(*arr[i+1], 2, 3, r, r+1,
- Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0);
- }
- else
- {
+ for (unsigned i = 0, r = start; i < n; i += 2) {
+ if (arr[i] && arr[i+1]) {
+ table.attach(*arr[i], 1, 2, r, r+1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0);
+ table.attach(*arr[i+1], 2, 3, r, r+1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0);
+ } else {
if (arr[i+1]) {
Gtk::AttachOptions yoptions = (Gtk::AttachOptions)0;
if (dynamic_cast<Inkscape::UI::Widget::PageSizer*>(arr[i+1])) {
// only the PageSizer in Document Properties|Page should be stretched vertically
yoptions = Gtk::FILL|Gtk::EXPAND;
}
- table.attach(*arr[i+1], 1, 3, r, r+1,
- Gtk::FILL|Gtk::EXPAND, yoptions, 0,0);
- }
- else if (arr[i])
- {
+ if (docum_prop_flag) {
+ if( i==(n-4) || i==(n-6) ) {
+ table.attach(*arr[i+1], 1, 3, r, r+1, Gtk::FILL|Gtk::EXPAND, yoptions, 20,0);
+ } else {
+ table.attach(*arr[i+1], 1, 3, r, r+1, Gtk::FILL|Gtk::EXPAND, yoptions, 0,0);
+ }
+ } else {
+ table.attach(*arr[i+1], 1, 3, r, r+1, Gtk::FILL|Gtk::EXPAND, yoptions, 0,0);
+ }
+ } else if (arr[i]) {
Gtk::Label& label = reinterpret_cast<Gtk::Label&>(*arr[i]);
label.set_alignment (0.0);
- table.attach (label, 0, 3, r, r+1,
- Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0);
- }
- else
- {
+ table.attach (label, 0, 3, r, r+1, Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0);
+ } else {
Gtk::HBox *space = manage (new Gtk::HBox);
space->set_size_request (SPACE_SIZE_X, SPACE_SIZE_Y);
- table.attach (*space, 0, 1, r, r+1,
- (Gtk::AttachOptions)0, (Gtk::AttachOptions)0,0,0);
+ table.attach (*space, 0, 1, r, r+1, (Gtk::AttachOptions)0, (Gtk::AttachOptions)0,0,0);
}
}
++r;
@@ -273,7 +270,12 @@ void DocumentProperties::build_page()
_rcp_bord._label, &_rcp_bord,
};
- attach_all(_page_page.table(), widget_array, G_N_ELEMENTS(widget_array));
+ std::list<Gtk::Widget*> _slaveList;
+ _slaveList.push_back(&_rcb_bord);
+ _slaveList.push_back(&_rcb_shad);
+ _rcb_canb.setSlaveWidgets(_slaveList);
+
+ attach_all(_page_page.table(), widget_array, G_N_ELEMENTS(widget_array),0,1);
}
void DocumentProperties::build_guides()
@@ -331,21 +333,13 @@ void DocumentProperties::build_snap()
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/// Populates the available color profiles combo box
void DocumentProperties::populate_available_profiles(){
-#if WITH_GTKMM_2_24
_combo_avail.remove_all(); // Clear any existing items in the combo box
-#else
- _combo_avail.clear_items(); // Clear any existing items in the combo box
-#endif
// Iterate through the list of profiles and add the name to the combo box.
std::vector<std::pair<Glib::ustring, Glib::ustring> > pairs = ColorProfile::getProfileFilesWithNames();
for ( std::vector<std::pair<Glib::ustring, Glib::ustring> >::const_iterator it = pairs.begin(); it != pairs.end(); ++it ) {
Glib::ustring name = it->second;
-#if WITH_GTKMM_2_24
_combo_avail.append(name);
-#else
- _combo_avail.append_text(name);
-#endif
}
}
@@ -926,7 +920,7 @@ void DocumentProperties::removeExternalScript(){
while ( current ) {
if (current->data && SP_IS_OBJECT(current->data)) {
SPObject* obj = SP_OBJECT(current->data);
- SPScript* script = (SPScript*) obj;
+ SPScript* script = SP_SCRIPT(obj);
if (name == script->xlinkhref){
//XML Tree being used directly here while it shouldn't be.
@@ -959,16 +953,18 @@ void DocumentProperties::removeEmbeddedScript(){
const GSList *current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
while ( current ) {
- SPObject* obj = SP_OBJECT(current->data);
- if (id == obj->getId()){
+ if (current->data && SP_IS_OBJECT(current->data)) {
+ SPObject* obj = SP_OBJECT(current->data);
+ if (id == obj->getId()){
- //XML Tree being used directly here while it shouldn't be.
- Inkscape::XML::Node *repr = obj->getRepr();
- if (repr){
- sp_repr_unparent(repr);
+ //XML Tree being used directly here while it shouldn't be.
+ Inkscape::XML::Node *repr = obj->getRepr();
+ if (repr){
+ sp_repr_unparent(repr);
- // inform the document, so we can undo
- DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_EMBEDDED_SCRIPT, _("Remove embedded script"));
+ // inform the document, so we can undo
+ DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_EMBEDDED_SCRIPT, _("Remove embedded script"));
+ }
}
}
current = g_slist_next(current);
@@ -1081,7 +1077,7 @@ void DocumentProperties::populate_script_lists(){
if (current) _scripts_observer.set(SP_OBJECT(current->data)->parent);
while ( current ) {
SPObject* obj = SP_OBJECT(current->data);
- SPScript* script = (SPScript*) obj;
+ SPScript* script = SP_SCRIPT(obj);
if (script->xlinkhref)
{
Gtk::TreeModel::Row row = *(_ExternalScriptsListStore->append());
@@ -1156,11 +1152,7 @@ void DocumentProperties::build_gridspage()
_grids_hbox_crea.pack_start(_grids_button_new, true, true);
for (gint t = 0; t <= GRID_MAXTYPENR; t++) {
-#if WITH_GTKMM_2_24
_grids_combo_gridtype.append( CanvasGrid::getName( (GridType) t ) );
-#else
- _grids_combo_gridtype.append_text( CanvasGrid::getName( (GridType) t ) );
-#endif
}
_grids_combo_gridtype.set_active_text( CanvasGrid::getName(GRID_RECTANGULAR) );