Skip to content

Commit c641925

Browse files
committed
Added new option, fixed accel warnings
1 parent 203eee6 commit c641925

File tree

6 files changed

+35
-7
lines changed

6 files changed

+35
-7
lines changed

data/gsettings/com.gexperts.Terminix.gschema.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@
6161
<!-- Global settings -->
6262
<schema id="com.gexperts.Terminix.Settings" path="/com/gexperts/Terminix/">
6363

64+
<key name="prompt-on-new-session" type="b">
65+
<default>true</default>
66+
<summary>Whether to prompt for session settings or use defaults.</summary>
67+
<description>If true, when creating a new session a prompt will appear to pick the session name and profile used.</description>
68+
</key>
6469
<!-- Dark Theme -->
6570
<key name="theme-variant" enum="com.gexperts.Terminix.ThemeVariant">
6671
<default>'system'</default>

source/gx/gtk/actions.d

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,16 @@ SimpleAction registerActionWithSettings(
8989
void delegate(glib.Variant.Variant, SimpleAction) cbStateChange = null
9090
) {
9191

92-
string shortcut = null;
92+
string[] shortcuts;
9393
try {
94-
shortcut = settings.getString(getActionKey(prefix, id));
95-
if (shortcut.length == 0) shortcut = SHORTCUT_DISABLED;
94+
string shortcut = settings.getString(getActionKey(prefix, id));
95+
if (shortcut.length > 0 && shortcut != SHORTCUT_DISABLED) shortcuts = [shortcut];
9696
} catch (Exception e) {
9797
//TODO - This does not work, figure out to catch GLib-GIO-ERROR
9898
trace(format("No shortcut for action %s.%s", prefix, id));
9999
}
100-
if (SHORTCUT_DISABLED == shortcut) shortcut = null;
101100

102-
return registerAction(actionMap, prefix, id, [shortcut], cbActivate, type, state, cbStateChange);
101+
return registerAction(actionMap, prefix, id, shortcuts, cbActivate, type, state, cbStateChange);
103102
}
104103

105104
/**

source/gx/terminix/appwindow.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ private:
9494

9595
//View sessions button
9696
mbSessions = new MenuButton();
97+
mbSessions.setTooltipText(_("Switch to a new session"));
9798
mbSessions.setFocusOnClick(false);
9899
Image iList = new Image("view-list-symbolic", IconSize.MENU);
99100
mbSessions.add(iList);

source/gx/terminix/preferences.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ enum SETTINGS_THEME_VARIANT_SYSTEM_VALUE = "system";
2222
enum SETTINGS_THEME_VARIANT_LIGHT_VALUE = "light";
2323
enum SETTINGS_THEME_VARIANT_DARK_VALUE = "dark";
2424

25+
enum SETTINGS_PROMPT_ON_NEW_SESSION_KEY = "prompt-on-new-session";
26+
2527
enum SETTINGS_SEARCH_DEFAULT_MATCH_CASE = "search-default-match-case";
2628
enum SETTINGS_SEARCH_DEFAULT_MATCH_ENTIRE_WORD = "search-default-match-entire-word";
2729
enum SETTINGS_SEARCH_DEFAULT_MATCH_AS_REGEX = "search-default-match-as-regex";

source/gx/terminix/prefwindow.d

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import gtk.Button;
2424
import gtk.CellRendererAccel;
2525
import gtk.CellRendererText;
2626
import gtk.CellRendererToggle;
27+
import gtk.CheckButton;
2728
import gtk.ComboBox;
2829
import gtk.Grid;
2930
import gtk.HeaderBar;
@@ -356,6 +357,26 @@ private:
356357
Settings settings = new Settings(SETTINGS_ID);
357358

358359
int row = 0;
360+
Label lblBehavior = new Label("");
361+
lblBehavior.setUseMarkup(true);
362+
lblBehavior.setHalign(Align.START);
363+
lblBehavior.setMarkup(format("<b>%s</b>", _("Behavior")));
364+
attach(lblBehavior, 0, row, 2, 1);
365+
row++;
366+
367+
//Prompt on new session
368+
CheckButton cbPrompt = new CheckButton(_("Prompt when creating a new session"));
369+
settings.bind(SETTINGS_PROMPT_ON_NEW_SESSION_KEY, cbPrompt, "active", GSettingsBindFlags.DEFAULT);
370+
attach(cbPrompt, 0, row, 2, 1);
371+
row++;
372+
373+
Label lblAppearance = new Label("");
374+
lblAppearance.setUseMarkup(true);
375+
lblAppearance.setHalign(Align.START);
376+
lblAppearance.setMarkup(format("<b>%s</b>", _("Appearance")));
377+
attach(lblAppearance, 0, row, 2, 1);
378+
row++;
379+
359380
//Dark Theme
360381
attach(createLabel(_("Theme Variant")), 0, row, 1, 1);
361382

source/gx/terminix/session.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ private:
482482

483483
Label label = new Label(format("<b>%s</b>", _("Name")));
484484
label.setUseMarkup(true);
485-
label.setHalign(Align.START);
485+
label.setHalign(Align.END);
486486
grid.attach(label, 0, 0, 1, 1);
487487

488488
eName = new Entry();
@@ -492,7 +492,7 @@ private:
492492

493493
label = new Label(format("<b>%s</b>", _("Profile")));
494494
label.setUseMarkup(true);
495-
label.setHalign(Align.START);
495+
label.setHalign(Align.END);
496496
grid.attach(label, 0, 1, 1, 1);
497497

498498
ProfileInfo[] profiles = prfMgr.getProfiles();

0 commit comments

Comments
 (0)