bugGNU Octave - Bugs: bug #39935, dialog button order incorrectly...

 
 

bug #39935: dialog button order incorrectly changes depending on CLI or GUI

Submitted by:  Rik <rik5>
Submitted on:  Tue 03 Sep 2013 11:32:28 PM UTC  
 
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: ConfirmedAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed 04 Sep 2013 03:04:52 PM UTC, comment #10:

Further confirmation, I am running the KDE desktop on Ubuntu 12.04 which explains the re-ordering.

It seems like we should set a generic button style that follows the programmer's desire rather than someone else's UI guidelines. It doesn't work well for a developer to write one Octave/Matlab GUI application and then have the buttons re-ordered depending on where it is run.

Rik <rik5>
Project Administrator
Wed 04 Sep 2013 12:11:56 PM UTC, comment #9:

I've confirmed my theory with a look at the Qt library source. It might be possible to fix this with a simple call to QMessageBox::setStyle, or it might require some more intrusive overriding.

See http://qt-project.org/doc/qt-4.8/qdialogbuttonbox.html#details and the screenshots of different system-specific button layouts.

Pointers into the Qt source if needed:

System-dependent layout definitions:

https://qt.gitorious.org/qt/qt/source/41372579efec1573179ad1eb8e5331723b6567c3:src/gui/widgets/qdialogbuttonbox.cpp#L215

Adding buttons in the order specified by the layout:

https://qt.gitorious.org/qt/qt/source/41372579efec1573179ad1eb8e5331723b6567c3:src/gui/widgets/qdialogbuttonbox.cpp#L410

Mike Miller <mtmiller>
Project Member
Wed 04 Sep 2013 11:19:22 AM UTC, comment #8:

Torsten: yes, I mean the window theme.

Michael Goffioul <goffioul>
Project Member
Wed 04 Sep 2013 07:51:14 AM UTC, comment #7:

Maybe this might be a hint:
http://askubuntu.com/questions/206023/how-do-i-prevent-kde-from-messing-up-my-qt-dialog-button-order

Torsten <ttl>
Project Member
Wed 04 Sep 2013 05:27:22 AM UTC, comment #6:

So we have two (different desktop environments?) Ubuntu 12.04 desktops with the same Qt version with different orderings.

The problem seems likely to be that QMessageBox intentionally changes the order of buttons depending on the platform, which possibly also includes the desktop environment or window manager. The ButtonRole enum is used along with the system environment to determine the button order.

See http://qt-project.org/doc/qt-5.0/qtwidgets/qmessagebox.html#advanced-usage

I see that do_question_dialog sets all three buttons to the same ButtonRole, but perhaps there is a secondary ordering index for buttons with the same role value?

Mike Miller <mtmiller>
Project Member
Wed 04 Sep 2013 04:54:37 AM UTC, comment #5:

I get BTN1-BTN2-BTN3 on ubuntu 12.04. with qt 4.8.1.
Does the behavior depend on the window theme?
What do you mean by qt-style?

Torsten <ttl>
Project Member
Wed 04 Sep 2013 03:53:23 AM UTC, comment #4:

Any good way to test the qt-style theory?

Rik <rik5>
Project Administrator
Wed 04 Sep 2013 02:36:19 AM UTC, comment #3:

Might it be qt-style dependent?

Michael Goffioul <goffioul>
Project Member
Wed 04 Sep 2013 01:44:04 AM UTC, comment #2:

I'm running Kubuntu 12.04 and the Qt version is 4.8.1. Attached are two pngs with the results I get.

(file #29001, file #29002)

Rik <rik5>
Project Administrator
Wed 04 Sep 2013 12:48:07 AM UTC, comment #1:

Hmm, I get consistent left-to-right in the GUI. Screenshot attached.

Could be dependent on Qt version or window manager?

(file #28999)

Mike Miller <mtmiller>
Project Member
Tue 03 Sep 2013 11:32:28 PM UTC, original submission:

The order of buttons when using a dialog function, such as questdlg, differs depending on whether the CLI or the GUI is running. In the CLI case, Java is used to create the dialog boxes. In the GUI case, Qt is used to create the dialog boxes.

In either case the results should be the same. It appears that the results for the GUI are exactly backward, right to left, from the CLI.

Sample code:

In this example, the buttons are actually ordered 3->2->1 instead of 1->2->3.

Rik <rik5>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #29001:  GUI.questdlg1.png added by rik5 (13kB - image/png)
file #29002:  CLI.questdlg.png added by rik5 (7kB - image/png)
file #28999:  questdlg.png added by mtmiller (28kB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ttl (Posted a comment)
  • -unavailable- added by goffioul (Posted a comment)
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by rik5 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 04 Sep 2013 12:11:55 PM UTCmtmillerStatusNeed Info=>Confirmed
    Wed 04 Sep 2013 01:44:04 AM UTCrik5Attached File-=>Added GUI.questdlg1.png, #29001
      Attached File-=>Added CLI.questdlg.png, #29002
    Wed 04 Sep 2013 12:48:07 AM UTCmtmillerAttached File-=>Added questdlg.png, #28999
      StatusNone=>Need Info
    Tue 03 Sep 2013 11:32:41 PM UTCrik5Summarydialog button order incorrectly changes dependin on CLI or GUI=>dialog button order incorrectly changes depending on CLI or GUI

    Back to the top


    Powered by Savane 3.1-cleanup