display: Use symbolic names for columns
Eeek...
This commit is contained in:
parent
39099a698b
commit
886801c97c
1 changed files with 23 additions and 14 deletions
|
@ -56,6 +56,15 @@ G_DEFINE_DYNAMIC_TYPE (CcDisplayPanel, cc_display_panel, CC_TYPE_PANEL)
|
||||||
#define MINIMUM_WIDTH 675
|
#define MINIMUM_WIDTH 675
|
||||||
#define MINIMUM_HEIGHT 530
|
#define MINIMUM_HEIGHT 530
|
||||||
|
|
||||||
|
enum {
|
||||||
|
TEXT_COL,
|
||||||
|
WIDTH_COL,
|
||||||
|
HEIGHT_COL,
|
||||||
|
RATE_COL,
|
||||||
|
AREA_COL,
|
||||||
|
ROTATION_COL
|
||||||
|
};
|
||||||
|
|
||||||
struct _CcDisplayPanelPrivate
|
struct _CcDisplayPanelPrivate
|
||||||
{
|
{
|
||||||
GnomeRRScreen *screen;
|
GnomeRRScreen *screen;
|
||||||
|
@ -314,7 +323,7 @@ foreach (GtkTreeModel *model,
|
||||||
ForeachInfo *info = data;
|
ForeachInfo *info = data;
|
||||||
char *text = NULL;
|
char *text = NULL;
|
||||||
|
|
||||||
gtk_tree_model_get (model, iter, 0, &text, -1);
|
gtk_tree_model_get (model, iter, TEXT_COL, &text, -1);
|
||||||
|
|
||||||
g_assert (text != NULL);
|
g_assert (text != NULL);
|
||||||
|
|
||||||
|
@ -348,12 +357,12 @@ add_key (GtkWidget *widget,
|
||||||
{
|
{
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
gtk_list_store_insert_with_values (store, &iter, -1,
|
gtk_list_store_insert_with_values (store, &iter, -1,
|
||||||
0, text,
|
TEXT_COL, text,
|
||||||
1, width,
|
WIDTH_COL, width,
|
||||||
2, height,
|
HEIGHT_COL, height,
|
||||||
3, rate,
|
RATE_COL, rate,
|
||||||
4, width * height,
|
AREA_COL, width * height,
|
||||||
5, rotation,
|
ROTATION_COL, rotation,
|
||||||
-1);
|
-1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -780,7 +789,7 @@ rebuild_gui (CcDisplayPanel *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
get_mode (GtkWidget *widget, int *width, int *height, int *freq, GnomeRRRotation *rot)
|
get_mode (GtkWidget *widget, int *width, int *height, int *rate, GnomeRRRotation *rot)
|
||||||
{
|
{
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
GtkTreeModel *model;
|
GtkTreeModel *model;
|
||||||
|
@ -796,18 +805,18 @@ get_mode (GtkWidget *widget, int *width, int *height, int *freq, GnomeRRRotation
|
||||||
if (!height)
|
if (!height)
|
||||||
height = &dummy;
|
height = &dummy;
|
||||||
|
|
||||||
if (!freq)
|
if (!rate)
|
||||||
freq = &dummy;
|
rate = &dummy;
|
||||||
|
|
||||||
if (!rot)
|
if (!rot)
|
||||||
rot = (GnomeRRRotation *)&dummy;
|
rot = (GnomeRRRotation *)&dummy;
|
||||||
|
|
||||||
model = gtk_combo_box_get_model (box);
|
model = gtk_combo_box_get_model (box);
|
||||||
gtk_tree_model_get (model, &iter,
|
gtk_tree_model_get (model, &iter,
|
||||||
1, width,
|
WIDTH_COL, width,
|
||||||
2, height,
|
HEIGHT_COL, height,
|
||||||
3, freq,
|
RATE_COL, rate,
|
||||||
5, rot,
|
ROTATION_COL, rot,
|
||||||
-1);
|
-1);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue